mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
fix memory overrun from silent sample writing
This commit is contained in:
parent
d697a6ea2c
commit
f80a077637
1 changed files with 1 additions and 1 deletions
|
@ -164,7 +164,7 @@ void AudioRingBuffer::addSilentFrame(int numSilentSamples) {
|
|||
_endOfLastWrite += numSilentSamples;
|
||||
} else {
|
||||
int numSamplesToEnd = (_buffer + _sampleCapacity) - _endOfLastWrite;
|
||||
memset(_endOfLastWrite, 0, numSilentSamples * sizeof(int16_t));
|
||||
memset(_endOfLastWrite, 0, numSamplesToEnd * sizeof(int16_t));
|
||||
memset(_buffer, 0, (numSilentSamples - numSamplesToEnd) * sizeof(int16_t));
|
||||
|
||||
_endOfLastWrite = _buffer + (numSilentSamples - numSamplesToEnd);
|
||||
|
|
Loading…
Reference in a new issue