Skip to content

Commit

Permalink
Fix overflow in audio code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergeanur committed Jul 3, 2021
1 parent 3136ce6 commit 77f3110
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/AudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void
cAudioManager::AdjustSamplesVolume()
{
for (int i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) {
tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] + 1];
tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]];

if (!pSample->m_bIs2D)
pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance);
Expand Down

0 comments on commit 77f3110

Please sign in to comment.