From d50b026da4caaa336b2afdf02d0f6615b25f802d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 4 Jan 2013 18:46:39 +0000 Subject: [PATCH] Fix crash when loading LV2 plugins with a corrupt LV2_Descriptor::extension_data. This is a plugin bug, but Ardour is supposed to check using the data as well. git-svn-id: svn://localhost/ardour2/branches/3.0@13777 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/lv2_plugin.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index b48c962d0c..2f5364d7f6 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -368,8 +368,12 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate) _data_access_extension_data.extension_data = _impl->instance->lv2_descriptor->extension_data; _data_access_feature.data = &_data_access_extension_data; - _impl->work_iface = (const LV2_Worker_Interface*)extension_data( - LV2_WORKER__interface); + LilvNode* worker_iface_uri = lilv_new_uri(_world.world, LV2_WORKER__interface); + if (lilv_plugin_has_extension_data(plugin, worker_iface_uri)) { + _impl->work_iface = (const LV2_Worker_Interface*)extension_data( + LV2_WORKER__interface); + } + lilv_node_free(worker_iface_uri); if (lilv_plugin_has_feature(plugin, _world.lv2_inPlaceBroken)) { error << string_compose(