1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-07 15:49:42 +02:00

Protect against blank parameter names

This commit is contained in:
lllucius 2014-12-07 18:26:22 +00:00
parent ed8dd09414
commit 2803bcd67a
2 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "../Audacity.h"
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/stopwatch.h>
#include <wx/tokenzr.h>
@ -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();

View File

@ -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))
{