diff options
author | David Robillard <d@drobilla.net> | 2010-10-04 18:44:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-10-04 18:44:38 +0000 |
commit | 96912c578dd1a040a453e04f225bfe3246b0a43a (patch) | |
tree | 8fc24e14d7a4a074ef41ce0cb27c4eb07c27c61e /src | |
parent | 14e30ac0256161439dd2bd7a80c3eba40abebad2 (diff) | |
download | ingen-96912c578dd1a040a453e04f225bfe3246b0a43a.tar.gz ingen-96912c578dd1a040a453e04f225bfe3246b0a43a.tar.bz2 ingen-96912c578dd1a040a453e04f225bfe3246b0a43a.zip |
Gracefully handle UIs that try to write to illegal port indices.
Patch from Lars Luthman (ticket #530).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2625 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/client/PluginUI.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 3a3b3270..74d87a13 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -53,7 +53,14 @@ lv2_ui_write(LV2UI_Controller controller, PluginUI* ui = (PluginUI*)controller; - SharedPtr<PortModel> port = ui->node()->ports()[port_index]; + NodeModel::Ports ports = ui->node()->ports(); + if (port_index >= ports.size()) { + error << "UI for " << ui->node()->plugin()->uri() + << " tried to write to non-existent port " << port_index << endl; + return; + } + + SharedPtr<PortModel> port = ports[port_index]; const Shared::LV2URIMap& uris = *ui->world()->uris().get(); |