[Bf-blender-cvs] [ae5a89e80af] master: Fix T93797, T93809: Crash/undefined-behavior when opening demo file

Julian Eisel noreply at git.blender.org
Tue Dec 7 12:03:37 CET 2021


Commit: ae5a89e80af78b85877a049d392a84553f2791aa
Author: Julian Eisel
Date:   Tue Dec 7 12:01:24 2021 +0100
Branches: master
https://developer.blender.org/rBae5a89e80af78b85877a049d392a84553f2791aa

Fix T93797, T93809: Crash/undefined-behavior when opening demo file

Error in d5efda72f501. Was changing an iteration that would free items
to an iterator that is not safe for use in such cases.

There still seem to be significant issues with the rendering, but that's
a separate issue to be fixed.

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

M	source/blender/nodes/shader/node_shader_tree.cc

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

diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc
index e913ca24130..9b2c48f4fb3 100644
--- a/source/blender/nodes/shader/node_shader_tree.cc
+++ b/source/blender/nodes/shader/node_shader_tree.cc
@@ -140,7 +140,7 @@ static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCa
 static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
 {
   /* replace muted nodes and reroute nodes by internal links */
-  LISTBASE_FOREACH (bNode *, node, &localtree->nodes) {
+  LISTBASE_FOREACH_MUTABLE (bNode *, node, &localtree->nodes) {
     if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
       nodeInternalRelink(localtree, node);
       ntreeFreeLocalNode(localtree, node);



More information about the Bf-blender-cvs mailing list