From 2803bcd67ab42c3dab309bb704a31a90455e13b9 Mon Sep 17 00:00:00 2001 From: lllucius Date: Sun, 7 Dec 2014 18:26:22 +0000 Subject: [PATCH] Protect against blank parameter names --- src/effects/EffectManager.cpp | 2 ++ src/effects/VST/VSTEffect.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/effects/EffectManager.cpp b/src/effects/EffectManager.cpp index 3e113fc3e..9e650dd7f 100644 --- a/src/effects/EffectManager.cpp +++ b/src/effects/EffectManager.cpp @@ -11,6 +11,7 @@ #include "../Audacity.h" +#include #include #include #include @@ -729,6 +730,7 @@ const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect); while (plug) { +wxLogDebug(wxT("id %s --- %s"), plug->GetID(), strTarget); if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget)) { return plug->GetID(); diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 9dc15d801..88438f072 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -2002,6 +2002,11 @@ bool VSTEffect::GetAutomationParameters(EffectAutomationParameters & parms) for (int i = 0; i < mAEffect->numParams; i++) { wxString name = GetString(effGetParamName, i); + if (name.IsEmpty()) + { + name.Printf(wxT("parm_%d"), i); + } + float value = callGetParameter(i); if (!parms.Write(name, value)) { @@ -2017,6 +2022,11 @@ bool VSTEffect::SetAutomationParameters(EffectAutomationParameters & parms) for (int i = 0; i < mAEffect->numParams; i++) { wxString name = GetString(effGetParamName, i); + if (name.IsEmpty()) + { + name.Printf(wxT("parm_%d"), i); + } + double d = 0.0; if (!parms.Read(name, &d)) {