summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-06 18:58:05 +0100
committerDavid Robillard <d@drobilla.net>2017-03-06 18:58:05 +0100
commit112061493cae8a669df359fa929dfd3ff87d7d0e (patch)
tree77935cee1972fac345533fa9880c94b2f2ed89f5
parentd8392945aacbf4ee854f0b36877a7d5e6b1aefcb (diff)
downloadlilv-112061493cae8a669df359fa929dfd3ff87d7d0e.tar.gz
lilv-112061493cae8a669df359fa929dfd3ff87d7d0e.tar.bz2
lilv-112061493cae8a669df359fa929dfd3ff87d7d0e.zip
Gracefully handle plugins with missing binary URIs
-rw-r--r--NEWS3
-rw-r--r--src/instance.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index d8db3d2..fa3f424 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,11 @@
lilv (0.24.3) unstable;
+ * Gracefully handle plugins with missing binary URIs
* Remove use of deprecated readdir_r
* Install Python bindings when configured without tests
(thanks Clement Skau)
- -- David Robillard <d@drobilla.net> Mon, 20 Feb 2017 19:38:44 +0100
+ -- David Robillard <d@drobilla.net> Mon, 06 Mar 2017 18:57:09 +0100
lilv (0.24.2) stable;
diff --git a/src/instance.c b/src/instance.c
index d05defd..93f0754 100644
--- a/src/instance.c
+++ b/src/instance.c
@@ -30,10 +30,14 @@ lilv_plugin_instantiate(const LilvPlugin* plugin,
return NULL;
}
- LilvInstance* result = NULL;
- const LilvNode* const lib_uri = lilv_plugin_get_library_uri(plugin);
- const LilvNode* const bundle_uri = lilv_plugin_get_bundle_uri(plugin);
- char* const bundle_path = lilv_file_uri_parse(
+ LilvInstance* result = NULL;
+ const LilvNode* const lib_uri = lilv_plugin_get_library_uri(plugin);
+ const LilvNode* const bundle_uri = lilv_plugin_get_bundle_uri(plugin);
+ if (!lib_uri || !bundle_uri) {
+ return NULL;
+ }
+
+ char* const bundle_path = lilv_file_uri_parse(
lilv_node_as_uri(bundle_uri), NULL);
LilvLib* lib = lilv_lib_open(plugin->world, lib_uri, bundle_path, features);