[Audio] Make sure m_MaxBufferSize is not bigger than MAX_SIZE

This commit is contained in:
zilmar 2022-04-11 09:05:04 +09:30
parent 80c21b4d5a
commit a3d32d5b46
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}