I happened to come across something that looks like a bug in the line where the dispatch gets called here in getProgramName():
const String getProgramName (int index) override
{
if (index >= 0)
{
if (index == getCurrentProgram())
return getCurrentProgramName();
if (vstEffect != nullptr)
{
char nm[264] = { 0 };
if (dispatch (Vst2::effGetProgramNameIndexed, jlimit (0, getNumPrograms(), index), -1, nm, 0) != 0)
return String::fromUTF8 (nm).trim();
}
}
return {};
}
Shouldn’t the upper limit of the jlimit be “getNumPrograms() - 1”?
(setCurrentProgram() seems to do this correctly)
I saw this on master, but I just checked and it’s also on develop.