si-audio-adapter: make sure formats is valid before iterating

This commit is contained in:
Julian Bouzas 2021-10-18 14:33:01 -04:00
parent 1bdb8c2fb3
commit ea229779a8

View file

@ -126,6 +126,8 @@ si_audio_adapter_find_format (WpSiAudioAdapter * self, WpNode * node)
formats = wp_pipewire_object_enum_params_sync (WP_PIPEWIRE_OBJECT (node),
"EnumFormat", NULL);
if (!formats)
return FALSE;
for (; wp_iterator_next (formats, &value); g_value_unset (&value)) {
WpSpaPod *pod = g_value_get_boxed (&value);