Skip to content

Commit

Permalink
[Audio] Make sure m_MaxBufferSize is not bigger than MAX_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed Apr 10, 2022
1 parent 80c21b4 commit a3d32d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Project64-audio/Driver/SoundBase.cpp
Expand Up @@ -33,6 +33,10 @@ void SoundDriverBase::AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize)
{
SetFrequency(Frequency, BufferSize);
m_MaxBufferSize = (BufferSize * 8);
if (m_MaxBufferSize > MAX_SIZE)
{
m_MaxBufferSize = MAX_SIZE;
}
m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0;
}

Expand Down

0 comments on commit a3d32d5

Please sign in to comment.