mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
pw-cli: handle NULL when iterating globals
It is possible that the global map contains holes and then the pw_map item has NULL data.
This commit is contained in:
parent
e258382bec
commit
1c6ce1778b
1 changed files with 5 additions and 2 deletions
|
|
@ -1720,9 +1720,11 @@ children_of(struct remote_data *rd, uint32_t parent_id,
|
|||
}
|
||||
i = 0;
|
||||
pw_array_for_each(item, &rd->globals.items) {
|
||||
if (pw_map_item_is_free(item))
|
||||
if (pw_map_item_is_free(item) || item->data == NULL)
|
||||
continue;
|
||||
|
||||
global = item->data;
|
||||
|
||||
if (strcmp(global->type, child_type))
|
||||
continue;
|
||||
|
||||
|
|
@ -2600,8 +2602,9 @@ static bool do_dump(struct data *data, const char *cmd, char *args, char **error
|
|||
}
|
||||
|
||||
pw_array_for_each(item, &rd->globals.items) {
|
||||
if (pw_map_item_is_free(item))
|
||||
if (pw_map_item_is_free(item) || item->data == NULL)
|
||||
continue;
|
||||
|
||||
global = item->data;
|
||||
|
||||
/* unknown type, ignore completely */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue