1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

VST: made sure the VstSpeakerConfiguration is never created with a size smaller than the original structure definition

This commit is contained in:
jules 2017-08-23 16:48:02 +01:00
parent f088225bce
commit 997c669260

View file

@ -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<size_t> (numChannels));
auto arrangementSize = sizeof (VstSpeakerConfiguration)
+ sizeof (VstIndividualSpeakerInfo) * static_cast<size_t> (jmax (8, numChannels) - 8);
storage.malloc (1, arrangementSize);
return storage.getData();