summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_plugin.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-11 02:35:31 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-11 02:35:31 +0000
commit680a3f2b865348a3a4d9c54cccc5155016ff4a98 (patch)
tree767beaf679bc7ac73034bb53c6f4b3f718064bfc /libs/ardour/vst_plugin.cc
parent173354c8470b77edeb920df026c0dabfc9af50d2 (diff)
Prevent garbage preset names with VST plugins when the call to get preset name fails.
git-svn-id: svn://localhost/ardour2/branches/3.0@8245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r--libs/ardour/vst_plugin.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index 26b3ce78f6..e77fc483ed 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -656,8 +656,11 @@ VSTPlugin::get_presets ()
if (vst_version >= 2) {
char buf[256];
- _plugin->dispatcher (_plugin, 29, i, 0, buf, 0);
- r.label = buf;
+ if (_plugin->dispatcher (_plugin, 29, i, 0, buf, 0) == 1) {
+ r.label = buf;
+ } else {
+ r.label = string_compose (_("Preset %1"), i);
+ }
} else {
r.label = string_compose (_("Preset %1"), i);
}