From 3c9dbc63d82b40df08041d7b0cc070fae53efe8f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 17 Sep 2016 20:27:12 -0400 Subject: Make lv2_features_data() tolerant of NULL features --- lv2/lv2plug.in/ns/lv2core/lv2_util.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lv2/lv2plug.in') diff --git a/lv2/lv2plug.in/ns/lv2core/lv2_util.h b/lv2/lv2plug.in/ns/lv2core/lv2_util.h index 038b5a6..561e201 100644 --- a/lv2/lv2plug.in/ns/lv2core/lv2_util.h +++ b/lv2/lv2plug.in/ns/lv2core/lv2_util.h @@ -41,9 +41,11 @@ static inline void* lv2_features_data(const LV2_Feature*const* features, const char* const uri) { - for (const LV2_Feature*const* f = features; *f; ++f) { - if (!strcmp(uri, (*f)->URI)) { - return (*f)->data; + if (features) { + for (const LV2_Feature*const* f = features; *f; ++f) { + if (!strcmp(uri, (*f)->URI)) { + return (*f)->data; + } } } return NULL; -- cgit v1.2.1