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.
This commit is contained in:
Wim Taymans 2025-07-21 10:14:39 +02:00
parent e6e36c4d34
commit 36f288f884

View file

@ -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);
}