From c22ac11afbb4b4f98cfe378203755bfc86f33f71 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 11 Jun 2016 21:18:19 -0300 Subject: [PATCH] fix crash in SamplePlayer, closes #5005 (cherry picked from commit ef9720c8f032ec85ccc45b21db5705050b5e2d48) --- scene/audio/sample_player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp index d7605ed1a95..d64dd5aa3e6 100644 --- a/scene/audio/sample_player.cpp +++ b/scene/audio/sample_player.cpp @@ -290,7 +290,7 @@ void SamplePlayer::stop_all() { #define _GET_VOICE\ uint32_t voice=p_voice&0xFFFF;\ - ERR_FAIL_COND(voice > (uint32_t)voices.size());\ + ERR_FAIL_COND(voice >= (uint32_t)voices.size());\ Voice &v=voices[voice];\ if (v.check!=uint32_t(p_voice>>16))\ return;\ @@ -381,7 +381,7 @@ void SamplePlayer::set_reverb(VoiceID p_voice,ReverbRoomType p_room,float p_send #define _GET_VOICE_V(m_ret)\ uint32_t voice=p_voice&0xFFFF;\ - ERR_FAIL_COND_V(voice > (uint32_t)voices.size(),m_ret);\ + ERR_FAIL_COND_V(voice >= (uint32_t)voices.size(),m_ret);\ const Voice &v=voices[voice];\ if (v.check!=(p_voice>>16))\ return m_ret;\