mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pod: Add validation to spa_pod_get_values()
Return no values if the size is too small for its type. Return at most one value if the size is misaligned for its type. Document all of this.
This commit is contained in:
parent
0b08468035
commit
42098fd8c1
3 changed files with 78 additions and 17 deletions
|
|
@ -435,10 +435,14 @@ spa_pod_parser_get_object(&p,
|
|||
\endcode
|
||||
|
||||
`spa_pod_get_values()` is a useful function. It returns a
|
||||
`struct spa_pod*` with and array of values. For normal POD's
|
||||
and choice none values, it simply returns the POD and one value.
|
||||
For other choice values it returns the choice type and an array
|
||||
of values:
|
||||
`struct spa_pod*` with and array of values. For invalid PODs
|
||||
it returns the POD and no values. For normal PODs it returns
|
||||
the POD and one value. For choice values it returns the choice
|
||||
type and an array of values. If the choice doesn't fit even a
|
||||
single value, the array will have no values. If the choice is
|
||||
of the `SPA_CHOICE_None` or the length of each element is
|
||||
misaligned, the array will have one value. Otherwise,
|
||||
the array will have the same length as the choice.
|
||||
|
||||
\code{.c}
|
||||
struct spa_pod *value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue