From 997c6692607177dec0e68bd0d68c240b8fe223fd Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 23 Aug 2017 16:48:02 +0100 Subject: [PATCH] VST: made sure the VstSpeakerConfiguration is never created with a size smaller than the original structure definition --- modules/juce_audio_processors/format_types/juce_VSTCommon.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTCommon.h b/modules/juce_audio_processors/format_types/juce_VSTCommon.h index 7d0a93b954..bda9ec84af 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTCommon.h +++ b/modules/juce_audio_processors/format_types/juce_VSTCommon.h @@ -180,8 +180,8 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e VstSpeakerConfiguration* allocate (int numChannels) { - auto arrangementSize = (sizeof (VstSpeakerConfiguration) - (sizeof(VstIndividualSpeakerInfo) * 8)) - + (sizeof (VstIndividualSpeakerInfo) * static_cast (numChannels)); + auto arrangementSize = sizeof (VstSpeakerConfiguration) + + sizeof (VstIndividualSpeakerInfo) * static_cast (jmax (8, numChannels) - 8); storage.malloc (1, arrangementSize); return storage.getData();