Cortex: Bounds checks in AudioFilterNode::processBuffer.

Processing more than framesRemaining leads to buffer overruns.
This commit is contained in:
Augustin Cavalier 2021-09-07 16:18:22 -04:00
parent dc912367ae
commit f91a86c46f

View File

@ -1498,6 +1498,9 @@ void AudioFilterNode::processBuffer(
ASSERT(toProcess > 0);
if (toProcess > framesRemaining)
toProcess = framesRemaining;
uint32 processed = m_op->process(
input, output, sourceOffset, destinationOffset, (uint32)toProcess, targetTime);
if(processed < toProcess) {
@ -1506,10 +1509,7 @@ void AudioFilterNode::processBuffer(
"*** AudioFilterNode::processBuffer(): insufficient frames filled\n"));
}
if(toProcess > framesRemaining)
framesRemaining = 0;
else
framesRemaining -= toProcess;
framesRemaining -= toProcess;
// advance target time
targetTime = nextEventTime; // +++++ might this drift from the real frame offset?