summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-23 19:53:29 -0400
committerDavid Robillard <d@drobilla.net>2023-09-23 19:53:29 -0400
commit8e4c4e44783e55b2766f33e711bd7fc04bf6d206 (patch)
treef99d73561899450068ff4d18941bced7deb51302 /src
parentc57b77099bd2cdc4fd8072f4cb314caecd6753ec (diff)
downloadlilv-8e4c4e44783e55b2766f33e711bd7fc04bf6d206.tar.gz
lilv-8e4c4e44783e55b2766f33e711bd7fc04bf6d206.tar.bz2
lilv-8e4c4e44783e55b2766f33e711bd7fc04bf6d206.zip
Fix crash when plugins pass NULL to the LV2_State_Retrieve_Function
Diffstat (limited to 'src')
-rw-r--r--src/state.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index e67714d..c8e8f14 100644
--- a/src/state.c
+++ b/src/state.c
@@ -226,9 +226,15 @@ retrieve_callback(LV2_State_Handle handle,
const Property* const prop = find_property((const LilvState*)handle, key);
if (prop) {
- *size = prop->size;
- *type = prop->type;
- *flags = prop->flags;
+ if (size) {
+ *size = prop->size;
+ }
+ if (type) {
+ *type = prop->type;
+ }
+ if (flags) {
+ *flags = prop->flags;
+ }
return prop->value;
}
return NULL;