spa: handle empty values better

Make sure the properties are not empty before trying to access them.
This commit is contained in:
Wim Taymans 2024-04-10 11:08:40 +02:00
parent 61af61a4b3
commit c534acac46
3 changed files with 13 additions and 6 deletions

View file

@ -687,6 +687,9 @@ static int add_int(struct format_info *info, const char *k, struct spa_pod *para
if (val->type != SPA_TYPE_Int)
return -ENOTSUP;
if (n_values == 0)
return -ENOENT;
values = SPA_POD_BODY(val);
switch (choice) {