fix crash in SamplePlayer, closes #5005

(cherry picked from commit ef9720c8f0)
This commit is contained in:
Juan Linietsky 2016-06-11 21:18:19 -03:00 committed by Rémi Verschelde
parent d945dbdd0f
commit c22ac11afb
1 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ void SamplePlayer::stop_all() {
#define _GET_VOICE\ #define _GET_VOICE\
uint32_t voice=p_voice&0xFFFF;\ 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];\ Voice &v=voices[voice];\
if (v.check!=uint32_t(p_voice>>16))\ if (v.check!=uint32_t(p_voice>>16))\
return;\ return;\
@ -381,7 +381,7 @@ void SamplePlayer::set_reverb(VoiceID p_voice,ReverbRoomType p_room,float p_send
#define _GET_VOICE_V(m_ret)\ #define _GET_VOICE_V(m_ret)\
uint32_t voice=p_voice&0xFFFF;\ 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];\ const Voice &v=voices[voice];\
if (v.check!=(p_voice>>16))\ if (v.check!=(p_voice>>16))\
return m_ret;\ return m_ret;\