From fa1b74611eb2dbafe4acf8c01f1319088fe75934 Mon Sep 17 00:00:00 2001 From: hogliux Date: Thu, 11 May 2017 09:57:05 +0100 Subject: [PATCH] VST2: Fixed a nullptr dereference when a VST2 host is supplying nullptrs to the VST2 processReplacing callback --- modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 63f4612348..20559c16cb 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -492,8 +492,12 @@ public: // copy back any temp channels that may have been used.. for (i = 0; i < numOut; ++i) - if (const FloatType* const chan = tmpBuffers.tempChannels.getUnchecked(i)) + { + const FloatType* const chan = tmpBuffers.tempChannels.getUnchecked(i); + + if (chan != nullptr && outputs[i] != nullptr) memcpy (outputs[i], chan, sizeof (FloatType) * (size_t) numSamples); + } } }