From 9174e5ca2009ca45a269992ff69e9b062f91b240 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 6 May 2020 15:45:19 +0200 Subject: [PATCH] parser: handle SPA_POD_None() in parser SPA_POD_None will have a NULL as the destination address of the pod value, so don't try to write to that. --- spa/include/spa/pod/parser.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index 99b9927a4..31f4c8849 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -398,10 +398,13 @@ do { \ case 'T': \ case 'O': \ case 'V': \ - *va_arg(args, const struct spa_pod**) = \ - (pod == NULL || (SPA_POD_TYPE(pod) == SPA_TYPE_None) \ + { \ + const struct spa_pod **d = va_arg(args, const struct spa_pod**); \ + if (d) \ + *d = (pod == NULL || (SPA_POD_TYPE(pod) == SPA_TYPE_None) \ ? NULL : pod); \ break; \ + } \ default: \ break; \ } \