mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Fix OOB access when stopping a sound that has invalid samples
This commit is contained in:
parent
9932bd76fb
commit
9390ae99b2
|
@ -228,10 +228,10 @@ void CSounds::Stop(int SetId)
|
|||
if(m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
|
||||
return;
|
||||
|
||||
CDataSoundset *pSet = &g_pData->m_aSounds[SetId];
|
||||
|
||||
const CDataSoundset *pSet = &g_pData->m_aSounds[SetId];
|
||||
for(int i = 0; i < pSet->m_NumSounds; i++)
|
||||
Sound()->Stop(pSet->m_aSounds[i].m_Id);
|
||||
if(pSet->m_aSounds[i].m_Id != -1)
|
||||
Sound()->Stop(pSet->m_aSounds[i].m_Id);
|
||||
}
|
||||
|
||||
bool CSounds::IsPlaying(int SetId)
|
||||
|
|
Loading…
Reference in a new issue