From 53cbc749865ed9e18d7a6c59f40cc77eb2c6c433 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 2 Dec 2013 11:17:43 +0000 Subject: [PATCH] Passed maximum name length when calling VST getParameterName(). --- modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp | 2 +- modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index 04077c144f..10dcb6865c 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -861,7 +861,7 @@ private: void GetNameOfLength (char* name, int maxLength, OSType inControllerType) const { // Pro-tools expects all your parameters to have valid names! - jassert (juceFilter->getParameterName (index).isNotEmpty()); + jassert (juceFilter->getParameterName (index, maxLength).isNotEmpty()); juceFilter->getParameterName (index, maxLength).copyToUTF8 (name, (size_t) maxLength + 1); } 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 678d3396c4..b8c4ee00e7 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -831,7 +831,7 @@ public: if (filter != nullptr) { jassert (isPositiveAndBelow (index, filter->getNumParameters())); - filter->getParameterText (index).copyToUTF8 (text, 24); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more. + filter->getParameterText (index, 24).copyToUTF8 (text, 24); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more. } } @@ -840,7 +840,7 @@ public: if (filter != nullptr) { jassert (isPositiveAndBelow (index, filter->getNumParameters())); - filter->getParameterName (index).copyToUTF8 (text, 16); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more. + filter->getParameterName (index, 16).copyToUTF8 (text, 16); // length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more. } }