summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-06 21:25:07 +0000
committerDavid Robillard <d@drobilla.net>2012-07-06 21:25:07 +0000
commit949f0c6d5fd353909f210a9ec1975bf4a545fc27 (patch)
treea359ee6520f12ca9490dfc98ee80fb662c0ef09b /utils
parent673ed3d0ce33a728f3b9a88bdb82be1f5522a27f (diff)
downloadlilv-949f0c6d5fd353909f210a9ec1975bf4a545fc27.tar.gz
lilv-949f0c6d5fd353909f210a9ec1975bf4a545fc27.tar.bz2
lilv-949f0c6d5fd353909f210a9ec1975bf4a545fc27.zip
Fix crash when lv2info is run with an invalid URI argument.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4508 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'utils')
-rw-r--r--utils/lv2info.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/lv2info.c b/utils/lv2info.c
index 101f9dc..53ad3d9 100644
--- a/utils/lv2info.c
+++ b/utils/lv2info.c
@@ -379,6 +379,13 @@ main(int argc, char** argv)
LilvWorld* world = lilv_world_new();
lilv_world_load_all(world);
+ LilvNode* uri = lilv_new_uri(world, plugin_uri);
+ if (!uri) {
+ fprintf(stderr, "Invalid plugin URI\n");
+ lilv_world_free(world);
+ return 1;
+ }
+
applies_to_pred = lilv_new_uri(world, LV2_CORE__appliesTo);
control_class = lilv_new_uri(world, LILV_URI_CONTROL_PORT);
event_class = lilv_new_uri(world, LILV_URI_EVENT_PORT);
@@ -389,7 +396,6 @@ main(int argc, char** argv)
supports_event_pred = lilv_new_uri(world, LV2_EVENT__supportsEvent);
const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
- LilvNode* uri = lilv_new_uri(world, plugin_uri);
const LilvPlugin* p = lilv_plugins_get_by_uri(plugins, uri);
if (p && plugin_file) {