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

Error in d5efda72f5. 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.
This commit is contained in:
Julian Eisel 2021-12-07 12:01:24 +01:00
parent 4312cb8545
commit ae5a89e80a
Notes: blender-bot 2023-02-14 02:22:07 +01:00
Referenced by issue #93809, Crash/undefined-behavior when opening demo file (heap-use-after-free of material node-tree in Eevee)
Referenced by issue #93797, Crash [or faulty eevee render] when opening UDIM_monster
1 changed files with 1 additions and 1 deletions

View File

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