mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pod: check that choices are not empty
Before using the contents of a choice, check that it is not empty to avoid reading out of bounds.
This commit is contained in:
parent
d37bdf5cbf
commit
b04da87e38
7 changed files with 18 additions and 4 deletions
|
|
@ -161,6 +161,7 @@ static void test_parse(void)
|
|||
uint32_t n_vals, choice;
|
||||
struct spa_pod *pod = spa_pod_get_values(&prop->value, &n_vals, &choice);
|
||||
|
||||
spa_assert_se(n_vals > 0);
|
||||
switch(prop->key) {
|
||||
case SPA_FORMAT_mediaType:
|
||||
spa_pod_get_id(pod, &vals.media_type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue