mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-22 16:18:12 +02:00
settings: make sure WpSpaJson is valid after doing wp_iterator_next()
This commit is contained in:
parent
b84261773a
commit
89dcd64003
1 changed files with 9 additions and 6 deletions
|
|
@ -449,7 +449,8 @@ parse_actions (const gchar *actions)
|
|||
g_autofree gchar *value = NULL;
|
||||
|
||||
g_value_unset (&item);
|
||||
wp_iterator_next (iter, &item);
|
||||
if (!wp_iterator_next (iter, &item))
|
||||
break;
|
||||
p = g_value_get_boxed (&item);
|
||||
|
||||
value = wp_spa_json_parse_string (p);
|
||||
|
|
@ -508,7 +509,8 @@ parse_matches (const gchar *match)
|
|||
WpConstraintVerb iverb = WP_CONSTRAINT_VERB_EQUALS;
|
||||
|
||||
g_value_unset (&o_item);
|
||||
wp_iterator_next (o_iter, &o_item);
|
||||
if (!wp_iterator_next (o_iter, &o_item))
|
||||
break;
|
||||
p = g_value_get_boxed (&o_item);
|
||||
|
||||
ivalue = value = wp_spa_json_parse_string (p);
|
||||
|
|
@ -588,10 +590,11 @@ is_rule (WpSpaJson *json)
|
|||
g_autoptr (WpIterator) iter = wp_spa_json_new_iterator (json);
|
||||
g_auto (GValue) item = G_VALUE_INIT;
|
||||
|
||||
wp_iterator_next (iter, &item);
|
||||
WpSpaJson *o = g_value_get_boxed (&item);
|
||||
if (o && wp_spa_json_is_object (o))
|
||||
return TRUE;
|
||||
if (wp_iterator_next (iter, &item)) {
|
||||
WpSpaJson *o = g_value_get_boxed (&item);
|
||||
if (o && wp_spa_json_is_object (o))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue