Cortex: Bounds checks in AudioFilterNode::processBuffer.
Processing more than framesRemaining leads to buffer overruns.
This commit is contained in:
@@ -1498,6 +1498,9 @@ void AudioFilterNode::processBuffer(
|
|||||||
|
|
||||||
ASSERT(toProcess > 0);
|
ASSERT(toProcess > 0);
|
||||||
|
|
||||||
|
if (toProcess > framesRemaining)
|
||||||
|
toProcess = framesRemaining;
|
||||||
|
|
||||||
uint32 processed = m_op->process(
|
uint32 processed = m_op->process(
|
||||||
input, output, sourceOffset, destinationOffset, (uint32)toProcess, targetTime);
|
input, output, sourceOffset, destinationOffset, (uint32)toProcess, targetTime);
|
||||||
if(processed < toProcess) {
|
if(processed < toProcess) {
|
||||||
@@ -1506,10 +1509,7 @@ void AudioFilterNode::processBuffer(
|
|||||||
"*** AudioFilterNode::processBuffer(): insufficient frames filled\n"));
|
"*** AudioFilterNode::processBuffer(): insufficient frames filled\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(toProcess > framesRemaining)
|
framesRemaining -= toProcess;
|
||||||
framesRemaining = 0;
|
|
||||||
else
|
|
||||||
framesRemaining -= toProcess;
|
|
||||||
|
|
||||||
// advance target time
|
// advance target time
|
||||||
targetTime = nextEventTime; // +++++ might this drift from the real frame offset?
|
targetTime = nextEventTime; // +++++ might this drift from the real frame offset?
|
||||||
|
|||||||
Reference in New Issue
Block a user