properties: handle prealloc of 0

The argument to array_init is not the prealloc but the extend, so
passing 0 will not work
This commit is contained in:
Wim Taymans 2019-01-29 16:52:21 +01:00
parent 086166058a
commit e4f58da013

View file

@ -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;
}