From 36f288f8840359c8e5a440e72c73106554c33a57 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 21 Jul 2025 10:14:39 +0200 Subject: [PATCH] pod: require at least 1 choice value in _can_collect() We can't collect the choice value when there is none so check for the number of choice values in _can_collect() as well. --- spa/include/spa/pod/parser.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index 233304053..bab03092a 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -286,6 +286,8 @@ SPA_API_POD_PARSER bool spa_pod_parser_can_collect(const struct spa_pod *pod, ch return true; if (SPA_POD_CHOICE_TYPE(pod) != SPA_CHOICE_None) return false; + if (SPA_POD_CHOICE_N_VALUES(pod) < 1) + return false; pod = SPA_POD_CHOICE_CHILD(pod); }