From d0b628f0a6d3f852825d4eb6f34e21e34a8dd1eb Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 7 Feb 2017 10:11:32 +0000 Subject: [PATCH] Added a workaround to avoid a crash in broken JUCE 4.1 synth plug-ins --- .../format_types/juce_VSTPluginFormat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 44eb9444ad..01d8bb61a7 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -1598,8 +1598,9 @@ private: HeapBlock inArrBlock (1, true), outArrBlock (1, true); - VstSpeakerConfiguration* inArr = inArrBlock.getData(), *outArr = outArrBlock.getData(); - if (effect->dispatchFunction (effect, plugInOpcodeGetSpeakerArrangement, 0, reinterpret_cast (&inArr), &outArr, 0.0f) == 0) + VstSpeakerConfiguration* inArr = inArrBlock.getData(), *outArr = outArrBlock.getData(); + if (effect->numInputChannels == 0 || + effect->dispatchFunction (effect, plugInOpcodeGetSpeakerArrangement, 0, reinterpret_cast (&inArr), &outArr, 0.0f) == 0) inArr = outArr = nullptr; for (int dir = 0; dir < 2; ++dir)