From e4f58da013b38c095f71e99ef2ad04960f98ba11 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Jan 2019 16:52:21 +0100 Subject: [PATCH] properties: handle prealloc of 0 The argument to array_init is not the prealloc but the extend, so passing 0 will not work --- src/pipewire/properties.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipewire/properties.c b/src/pipewire/properties.c index 27951b087..619565e2d 100644 --- a/src/pipewire/properties.c +++ b/src/pipewire/properties.c @@ -75,7 +75,8 @@ static struct properties *properties_new(int prealloc) if (impl == NULL) return NULL; - pw_array_init(&impl->items, prealloc); + pw_array_init(&impl->items, 16); + pw_array_ensure_size(&impl->items, sizeof(struct spa_dict_item) * prealloc); return impl; }