mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-30 21:37:53 -04:00
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:
parent
7cfcb46fbf
commit
5802826966
2 changed files with 2 additions and 2 deletions
|
|
@ -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].key = key;
|
||||||
items[n].value = value;
|
items[n].value = value;
|
||||||
}
|
}
|
||||||
dict->items = items;
|
*dict = SPA_DICT_INIT(items, n);
|
||||||
spa_pod_parser_pop(&prs, &f[0]);
|
spa_pod_parser_pop(&prs, &f[0]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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].key = key;
|
||||||
items[n].value = value;
|
items[n].value = value;
|
||||||
}
|
}
|
||||||
dict->items = items;
|
*dict = SPA_DICT_INIT(items, n);
|
||||||
spa_pod_parser_pop(&prs, &f[0]);
|
spa_pod_parser_pop(&prs, &f[0]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue