Add some more format checks

The format parse functions don't really check if the parsed values
make any sense so we need to to this ourselves.
This commit is contained in:
Wim Taymans 2022-11-03 13:10:32 +01:00
parent c30d743198
commit 74447acedb
24 changed files with 182 additions and 59 deletions

View file

@ -599,8 +599,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
if ((res = spa_format_parse(param, &info.media_type, &info.media_subtype)) < 0)
return res;
if (info.media_type != SPA_MEDIA_TYPE_video ||
info.media_subtype != SPA_MEDIA_SUBTYPE_raw)
return -EINVAL;
info.media_subtype != SPA_MEDIA_SUBTYPE_raw)
return -EINVAL;
if (spa_format_video_raw_parse(param, &info.info.raw) < 0)
return -EINVAL;