[Bf-blender-cvs] [a0a08c643ee] master: Fix (unreported) potential infinite loop over collections' parents pointers.

Bastien Montagne noreply at git.blender.org
Thu Apr 11 18:02:49 CEST 2019


Commit: a0a08c643ee13cddde6416363940a697c5d9c194
Author: Bastien Montagne
Date:   Wed Apr 3 11:05:16 2019 +0200
Branches: master
https://developer.blender.org/rBa0a08c643ee13cddde6416363940a697c5d9c194

Fix (unreported) potential infinite loop over collections' parents pointers.

It is crucial to properly tag as loopback that kind of pointers,
otherwise some users of libquery's foreach_ID might end up in infinite
loops.

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

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

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

diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index cdbbc404538..4fc1ea6bb62 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -783,7 +783,7 @@ static void library_foreach_ID_link(
 					CALLBACK_INVOKE(child->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_USER);
 				}
 				for (CollectionParent *parent = collection->parents.first; parent; parent = parent->next) {
-					CALLBACK_INVOKE(parent->collection, IDWALK_CB_NEVER_SELF);
+					CALLBACK_INVOKE(parent->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_LOOPBACK);
 				}
 				break;
 			}



More information about the Bf-blender-cvs mailing list