mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
VST: Fixed potential out-of-bounds program access
This commit is contained in:
parent
9f0728e622
commit
f3470d3cd4
2 changed files with 10 additions and 3 deletions
|
|
@ -2229,10 +2229,17 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
int getNumPrograms() override { return programNames.size(); }
|
||||
const String getProgramName (int index) override { return programNames[index]; }
|
||||
int getCurrentProgram() override { return jmax (0, roundToInt (editController->getParamNormalized (programParameterID) * (programNames.size() - 1))); }
|
||||
const String getProgramName (int index) override { return index >= 0 ? programNames[index] : String(); }
|
||||
void changeProgramName (int, const String&) override {}
|
||||
|
||||
int getCurrentProgram() override
|
||||
{
|
||||
if (programNames.size() > 0 && editController != nullptr)
|
||||
return jmax (0, roundToInt (editController->getParamNormalized (programParameterID) * (programNames.size() - 1)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void setCurrentProgram (int program) override
|
||||
{
|
||||
if (programNames.size() > 0 && editController != nullptr)
|
||||
|
|
|
|||
|
|
@ -1596,7 +1596,7 @@ struct VSTPluginInstance : public AudioPluginInstance,
|
|||
}
|
||||
}
|
||||
|
||||
return programNames [index];
|
||||
return {};
|
||||
}
|
||||
|
||||
void changeProgramName (int index, const String& newName) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue