From f743aecd23df3fa11fff5c4eefaca0ee734fca40 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 9 Feb 2022 15:17:37 +0100 Subject: [PATCH] map: scale extend with the item size as well --- src/pipewire/map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/map.h b/src/pipewire/map.h index 1867fa4d3..f2b54fc7c 100644 --- a/src/pipewire/map.h +++ b/src/pipewire/map.h @@ -115,7 +115,7 @@ struct pw_map { */ static inline void pw_map_init(struct pw_map *map, size_t size, size_t extend) { - pw_array_init(&map->items, extend); + pw_array_init(&map->items, extend * sizeof(union pw_map_item)); pw_array_ensure_size(&map->items, size * sizeof(union pw_map_item)); map->free_list = SPA_ID_INVALID; }