mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-19 06:46:26 -04:00
spa: add some more POD tests
Check if the pod size is at least big enough to hold 1 item when getting array or choice items. Check that the number of choice values is at least enough to handle the given choice type. Remove some redundant checks.
This commit is contained in:
parent
77a5100280
commit
95fb03c8e3
4 changed files with 30 additions and 9 deletions
|
|
@ -164,8 +164,7 @@ SPA_API_DEBUG_FORMAT int spa_debugc_format(struct spa_debug_context *ctx, int in
|
|||
type = val->type;
|
||||
size = val->size;
|
||||
|
||||
if (type < SPA_TYPE_None || type >= _SPA_TYPE_LAST || n_vals < 1 ||
|
||||
size < spa_pod_type_size(type))
|
||||
if (type < SPA_TYPE_None || type >= _SPA_TYPE_LAST || n_vals < 1)
|
||||
continue;
|
||||
|
||||
vals = SPA_POD_BODY(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue