Skip to content

Commit

Permalink
Properly handle when plugin has no maker, param or program name
Browse files Browse the repository at this point in the history
This is triggered when a plugin crashes while initializing,
thus the plugin information is not filled properly and currupts the dssi-vst cache
  • Loading branch information
falkTX committed Aug 27, 2012
1 parent 0dd6cd4 commit a75920b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dssi-vst-scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)

memset(buffer, 0, 65);
plugin->dispatcher(plugin, effGetVendorString, 0, 0, buffer, 0);
if (buffer[0] == '\0') {
snprintf(buffer, 64, "Unknown");
}
write(fd, buffer, 64);

synth = false;
Expand All @@ -377,6 +380,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
for (i = 0; i < params; ++i) {
memset(buffer, 0, 65);
plugin->dispatcher(plugin, effGetParamName, i, 0, buffer, 0);
if (buffer[0] == '\0') {
snprintf(buffer, 64, "Unnamed %i", i);
}
write(fd, buffer, 64);
float f = plugin->getParameter(plugin, i);
write(fd, &f, sizeof(float));
Expand All @@ -392,6 +398,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
// pass in <index> as well, just in case
plugin->dispatcher(plugin, effSetProgram, 0, i, NULL, 0);
plugin->dispatcher(plugin, effGetProgramName, i, 0, buffer, 0);
if (buffer[0] == '\0') {
snprintf(buffer, 64, "Unnamed %i", i);
}
write(fd, buffer, 64);
}

Expand Down

0 comments on commit a75920b

Please sign in to comment.