From d3f8c39e37bca1797934651ae25b287cb0109c78 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Feb 2013 20:36:16 +0000 Subject: Fix crash when a broken UI returns a NULL descriptor (#886). git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5052 a436a847-0d15-0410-975c-d299462d15a1 --- AUTHORS | 2 ++ NEWS | 3 ++- src/instance.c | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index fb9e3bc..70cccdb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,3 +4,5 @@ Contributors: * Devin Anderson * Fix reparenting of Gtk UIs in Qt + * Peter Nelson + * Fix crash when a broken UI returns a NULL descriptor diff --git a/NEWS b/NEWS index 0c37478..16b73aa 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,9 @@ suil (0.6.11) unstable; + * Fix crash when a broken UI returns a NULL descriptor * Fix compilation on BSD - -- David Robillard Sat, 02 Feb 2013 21:31:54 -0500 + -- David Robillard Sat, 09 Feb 2013 15:31:44 -0500 suil (0.6.10) stable; diff --git a/src/instance.c b/src/instance.c index 617280e..d5e744a 100644 --- a/src/instance.c +++ b/src/instance.c @@ -171,7 +171,9 @@ suil_instance_new(SuilHost* host, const LV2UI_Descriptor* descriptor = NULL; for (uint32_t i = 0; true; ++i) { const LV2UI_Descriptor* ld = df(i); - if (!strcmp(ld->URI, ui_uri)) { + if (!ld) { + break; + } else if (!strcmp(ld->URI, ui_uri)) { descriptor = ld; break; } -- cgit v1.2.1