summaryrefslogtreecommitdiff
path: root/libs/ardour/ladspa_plugin.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-02-27 15:21:29 +0000
committerCarl Hetherington <carl@carlh.net>2012-02-27 15:21:29 +0000
commitaf7494ceb243d68e900c3c6464ec1038a2921f32 (patch)
treef36b42640ee2f7e7d4fb03336745d107d22b6ee9 /libs/ardour/ladspa_plugin.cc
parentbd2e28aaacaf75448324cdd139d2062ce595d2c1 (diff)
Slightly tweaked patch from colinf to avoid crashes on
out-of-range LADSPA port indices (#4700). git-svn-id: svn://localhost/ardour2/branches/3.0@11528 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ladspa_plugin.cc')
-rw-r--r--libs/ardour/ladspa_plugin.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index b9400dd8d8..3a25eab384 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -916,3 +916,16 @@ LadspaPlugin::do_save_preset (string name)
return uri;
}
+LADSPA_PortDescriptor
+LadspaPlugin::port_descriptor (uint32_t i) const
+{
+ if (i < _descriptor->PortCount) {
+ return _descriptor->PortDescriptors[i];
+ }
+
+ warning << "LADSPA plugin port index " << i << " out of range." << endmsg;
+ return 0;
+}
+
+
+