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

AU Wrapper: Ensure that correct input channels are cleared before processing

This commit is contained in:
reuk 2022-02-08 15:09:48 +00:00
parent 1bf9ebb4b1
commit 72fa2d98e1
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -232,8 +232,12 @@ struct AudioUnitHelpers
private:
void clearChannels (int begin, int end)
{
for (auto i = begin; i < end; ++i)
zeromem (scratch.getWritePointer (i), sizeof (float) * (size_t) scratch.getNumSamples());
if (begin <= end && end <= (int) channels.size())
{
std::for_each (channels.begin() + begin,
channels.begin() + end,
[this] (float* ptr) { zeromem (ptr, sizeof (float) * (size_t) scratch.getNumSamples()); });
}
}
float* uniqueBuffer (int idx, float* buffer) noexcept