A bit of crash proofiness for insane plugin UIs.
authorDavid Robillard <d@drobilla.net>
Thu, 12 Apr 2012 04:03:14 +0000 (04:03 +0000)
committerDavid Robillard <d@drobilla.net>
Thu, 12 Apr 2012 04:03:14 +0000 (04:03 +0000)
Plugin UI touch confirmed working with suil r4173 and distrho JUCE plugin "TAL Filter II".

git-svn-id: svn://localhost/ardour2/branches/3.0@11935 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/lv2_plugin_ui.cc

index 96f2a182b76f5d9229ad5a284a74c706e5f08826..5f9f024636d43f9433cfe9fcd823782376486fd8 100644 (file)
@@ -86,7 +86,11 @@ LV2PluginUI::touch(void*    controller,
                    uint32_t port_index,
                    bool     grabbed)
 {
-       LV2PluginUI*    me      = (LV2PluginUI*)controller;
+       LV2PluginUI* me = (LV2PluginUI*)controller;
+       if (port_index >= me->_controllables.size()) {
+               return;
+       }
+
        ControllableRef control = me->_controllables[port_index];
        if (grabbed) {
                control->start_touch(control->session().transport_frame());