spa: param: spa_{param_dict,tag}_info_parse(): update size as well

In both functions the loop can break early, meaning that the true number
of valid items is `n`, and that should be reflected in the updated `*dict`.
This commit is contained in:
Barnabás Pőcze 2026-05-12 20:46:37 +02:00
parent 7cfcb46fbf
commit 5802826966
2 changed files with 2 additions and 2 deletions

View file

@ -109,7 +109,7 @@ spa_param_dict_info_parse(const struct spa_param_dict_info *info, size_t size,
items[n].key = key;
items[n].value = value;
}
dict->items = items;
*dict = SPA_DICT_INIT(items, n);
spa_pod_parser_pop(&prs, &f[0]);
return 0;
}

View file

@ -96,7 +96,7 @@ spa_tag_info_parse(const struct spa_tag_info *info, struct spa_dict *dict, struc
items[n].key = key;
items[n].value = value;
}
dict->items = items;
*dict = SPA_DICT_INIT(items, n);
spa_pod_parser_pop(&prs, &f[0]);
return 0;
}