[Bf-blender-cvs] [2161840d07a] blender-v2.93-release: Fix (studio-reported) crash in collection management code.

Bastien Montagne noreply at git.blender.org
Mon May 31 11:25:18 CEST 2021


Commit: 2161840d07ae0a934a734ac6198aa7e5cc4b6fcf
Author: Bastien Montagne
Date:   Mon May 31 10:20:23 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB2161840d07ae0a934a734ac6198aa7e5cc4b6fcf

Fix (studio-reported) crash in collection management code.

Code checking for potential collection loop dependencies can be called
in cases where we cannot guarantee that there is no NULL pointers, so we
need to check those. Was already done for objects.

NOTE: doubled-checked by @jbakker, thanks.

===================================================================

M	source/blender/blenkernel/intern/collection.c

===================================================================

diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 3170c3aa65c..2813f535eb5 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1425,7 +1425,8 @@ static bool collection_instance_find_recursive(Collection *collection,
   }
 
   LISTBASE_FOREACH (CollectionChild *, collection_child, &collection->children) {
-    if (collection_instance_find_recursive(collection_child->collection, instance_collection)) {
+    if (collection_child->collection != NULL &&
+        collection_instance_find_recursive(collection_child->collection, instance_collection)) {
       return true;
     }
   }



More information about the Bf-blender-cvs mailing list