mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 17:11:17 +02:00
Protect against blank parameter names
This commit is contained in:
parent
ed8dd09414
commit
2803bcd67a
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "../Audacity.h"
|
#include "../Audacity.h"
|
||||||
|
|
||||||
|
#include <wx/log.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
#include <wx/stopwatch.h>
|
#include <wx/stopwatch.h>
|
||||||
#include <wx/tokenzr.h>
|
#include <wx/tokenzr.h>
|
||||||
@ -729,6 +730,7 @@ const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget
|
|||||||
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
|
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
|
||||||
while (plug)
|
while (plug)
|
||||||
{
|
{
|
||||||
|
wxLogDebug(wxT("id %s --- %s"), plug->GetID(), strTarget);
|
||||||
if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget))
|
if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget))
|
||||||
{
|
{
|
||||||
return plug->GetID();
|
return plug->GetID();
|
||||||
|
@ -2002,6 +2002,11 @@ bool VSTEffect::GetAutomationParameters(EffectAutomationParameters & parms)
|
|||||||
for (int i = 0; i < mAEffect->numParams; i++)
|
for (int i = 0; i < mAEffect->numParams; i++)
|
||||||
{
|
{
|
||||||
wxString name = GetString(effGetParamName, i);
|
wxString name = GetString(effGetParamName, i);
|
||||||
|
if (name.IsEmpty())
|
||||||
|
{
|
||||||
|
name.Printf(wxT("parm_%d"), i);
|
||||||
|
}
|
||||||
|
|
||||||
float value = callGetParameter(i);
|
float value = callGetParameter(i);
|
||||||
if (!parms.Write(name, value))
|
if (!parms.Write(name, value))
|
||||||
{
|
{
|
||||||
@ -2017,6 +2022,11 @@ bool VSTEffect::SetAutomationParameters(EffectAutomationParameters & parms)
|
|||||||
for (int i = 0; i < mAEffect->numParams; i++)
|
for (int i = 0; i < mAEffect->numParams; i++)
|
||||||
{
|
{
|
||||||
wxString name = GetString(effGetParamName, i);
|
wxString name = GetString(effGetParamName, i);
|
||||||
|
if (name.IsEmpty())
|
||||||
|
{
|
||||||
|
name.Printf(wxT("parm_%d"), i);
|
||||||
|
}
|
||||||
|
|
||||||
double d = 0.0;
|
double d = 0.0;
|
||||||
if (!parms.Read(name, &d))
|
if (!parms.Read(name, &d))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user