diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index d6e1fc5d1..05df98340 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -301,6 +301,8 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b, p2 = spa_pod_object_find_prop(of, p2, p1->key); if (p2 != NULL) res = spa_pod_filter_prop(b, p1, p2); + else if ((p1->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0) + res = -EINVAL; else spa_pod_builder_raw_padded(b, p1, SPA_POD_PROP_SIZE(p1)); if (res < 0) @@ -312,7 +314,10 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b, p1 = spa_pod_object_find_prop(op, p1, p2->key); if (p1 != NULL) continue; - + if ((p2->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0) + res = -EINVAL; + if (res < 0) + break; spa_pod_builder_raw_padded(b, p2, SPA_POD_PROP_SIZE(p2)); } }