From 3ff5ed0f44a2456c28793fb2ec700034c3ab5e74 Mon Sep 17 00:00:00 2001 From: hogliux Date: Thu, 7 Jul 2016 17:41:23 +0100 Subject: [PATCH] Reject any inconsistent VST-2 channel layout requests --- .../VST/juce_VST_Wrapper.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 7d671525bc..83b1ecf02e 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -938,6 +938,20 @@ public: if (pluginOutput != nullptr && numOuts == 0) return false; + if (pluginInput != nullptr && pluginInput->type >= 0) + { + // inconsistent request? + if (SpeakerMappings::vstArrangementTypeToChannelSet (*pluginInput).size() != pluginInput->numChannels) + return false; + } + + if (pluginOutput != nullptr && pluginOutput->type >= 0) + { + // inconsistent request? + if (SpeakerMappings::vstArrangementTypeToChannelSet (*pluginOutput).size() != pluginOutput->numChannels) + return false; + } + if (numIns > 1 || numOuts > 1) { int newNumInChannels = (pluginInput != nullptr && pluginInput-> numChannels >= 0) ? pluginInput-> numChannels