From 9b4ba780ed7615a08b4cd070d2ea0a564503e4a0 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 29 Oct 2018 16:51:10 +0000 Subject: [PATCH] Fixed a potential out-of-bounds array access in the CoreAudio internals --- modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index 28ab1b28a0..fdf234e809 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -464,6 +464,9 @@ public: inputChannelInfo.swapWith (newInChans); outputChannelInfo.swapWith (newOutChans); + numInputChans = inputChannelInfo.size(); + numOutputChans = outputChannelInfo.size(); + allocateTempBuffers(); } @@ -778,7 +781,7 @@ public: for (int i = numOutputChans; --i >= 0;) { - auto& info = outputChannelInfo.getReference(i); + auto& info = outputChannelInfo.getReference (i); auto src = tempOutputBuffers[i]; auto dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) + info.dataOffsetSamples; auto stride = info.dataStrideSamples;