fix for writing to freed memory enabling texture node tree
authorCampbell Barton <ideasman42@gmail.com>
Sat, 27 Jul 2013 08:21:43 +0000 (08:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 27 Jul 2013 08:21:43 +0000 (08:21 +0000)
source/blender/nodes/texture/node_texture_tree.c

index 859636ed4e5d2b163e01069ac6cda256d1b6bda7..5e863da96353b99c55cb49476e63453dca5143c8 100644 (file)
@@ -283,10 +283,12 @@ void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
 void ntreeTexEndExecTree(bNodeTreeExec *exec)
 {
        if (exec) {
+               /* exec may get freed, so assign ntree */
+               bNodeTree *ntree = exec->nodetree;
                ntreeTexEndExecTree_internal(exec);
                
                /* XXX clear nodetree backpointer to exec data, same problem as noted in ntreeBeginExecTree */
-               exec->nodetree->execdata = NULL;
+               ntree->execdata = NULL;
        }
 }