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 --- src/instance.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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