1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AU Client: Avoid potential out-of-bounds write when clearing buffers

Fixes an issue introduced in 72fa2d98e1
where zeromem might write past the end of the channel buffer.
This commit is contained in:
reuk 2022-02-22 13:05:17 +00:00
parent 45ae98effd
commit 288765b3c8
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
3 changed files with 14 additions and 12 deletions

View file

@ -1346,10 +1346,10 @@ public:
if (pulledSucceeded[busIdx])
audioBuffer.set (busIdx, GetInput ((UInt32) busIdx)->GetBufferList(), mapper.get (true, busIdx));
else
audioBuffer.clearInputBus (busIdx);
audioBuffer.clearInputBus (busIdx, (int) nFrames);
}
audioBuffer.clearUnusedChannels();
audioBuffer.clearUnusedChannels ((int) nFrames);
}
// swap midi buffers

View file

@ -1617,7 +1617,7 @@ private:
for (int busIdx = 0; busIdx < numProcessorBusesIn; ++busIdx)
audioBuffer.set (busIdx, *inBusBuffers[busIdx]->get(), mapper.get (true, busIdx));
audioBuffer.clearUnusedChannels();
audioBuffer.clearUnusedChannels ((int) frameCount);
}
// process audio