mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pipewire: map: initialize free_list to SPA_ID_INVALID
If `struct pw_map::free_list` is not initialized to `SPA_ID_INVALID`, then `pw_map_insert()` will try to read `map->items.data[0]` when inserting the first element, but `data` is a `NULL` pointer after initialization.
This commit is contained in:
parent
0eb46d8ef4
commit
2a8d511be8
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ struct pw_map {
|
|||
uint32_t free_list; /**< the free items */
|
||||
};
|
||||
|
||||
#define PW_MAP_INIT(extend) (struct pw_map) { PW_ARRAY_INIT(extend), 0 }
|
||||
#define PW_MAP_INIT(extend) (struct pw_map) { PW_ARRAY_INIT(extend), SPA_ID_INVALID }
|
||||
|
||||
#define pw_map_get_size(m) pw_array_get_len(&(m)->items, union pw_map_item)
|
||||
#define pw_map_get_item(m,id) pw_array_get_unchecked(&(m)->items,id,union pw_map_item)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue