From 1fb3ee2e14c7ffc2667e2ffd05d6cb7072f9af13 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 31 Aug 2014 14:37:41 +0100 Subject: [PATCH] VST3 hosting memory allocation fix. --- .../format_types/juce_VST3PluginFormat.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index e640ca714a..a7416264c8 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -2112,7 +2112,11 @@ private: MemoryBlock mem; if (mem.fromBase64Encoding (state->getAllSubText())) - stream = new Steinberg::MemoryStream (mem.getData(), (TSize) mem.getSize()); + { + stream = new Steinberg::MemoryStream(); + stream->setSize ((TSize) mem.getSize()); + mem.copyTo (stream->getData(), 0, mem.getSize()); + } } return stream;