Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/collection.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 426f8a44aff..8e4633cbe15 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -2015,12 +2015,10 @@ static void scene_collections_array(Scene *scene,
BLI_assert(collection != NULL);
scene_collection_callback(collection, scene_collections_count, r_collections_array_len);
- if (*r_collections_array_len == 0) {
- return;
- }
+ BLI_assert(*r_collections_array_len > 0);
- Collection **array = MEM_mallocN(sizeof(Collection *) * (*r_collections_array_len),
- "CollectionArray");
+ Collection **array = MEM_malloc_arrayN(
+ *r_collections_array_len, sizeof(Collection *), "CollectionArray");
*r_collections_array = array;
scene_collection_callback(collection, scene_collections_build_array, &array);
}