Fixed potential crash in NodeTagIDChanged. Discovered after merge trunk
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Sep 2011 18:15:34 +0000 (18:15 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Sep 2011 18:15:34 +0000 (18:15 +0000)
into tomato where there were no check for tree before calling this function.
Old design worked fine with this.

Mark some arguments as UNUSED.

source/blender/blenkernel/intern/node.c
source/blender/nodes/composite/nodes/node_composite_common.c

index 47fc72f..292f38b 100644 (file)
@@ -1534,13 +1534,15 @@ void NodeTagChanged(bNodeTree *ntree, bNode *node)
 
 int NodeTagIDChanged(bNodeTree *ntree, ID *id)
 {
-       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype;
        bNode *node;
        int change = FALSE;
 
        if(ELEM(NULL, id, ntree))
                return change;
        
+       ntreetype = ntreeGetType(ntree->type);
+       
        if (ntreetype->update_node) {
                for(node= ntree->nodes.first; node; node= node->next) {
                        if(node->id==id) {
index 8067f7e..d5ae442 100644 (file)
@@ -135,7 +135,7 @@ static void *group_initexec(bNode *node)
        return exec;
 }
 
-static void group_freeexec(bNode *node, void *nodedata)
+static void group_freeexec(bNode *UNUSED(node), void *nodedata)
 {
        bNodeTreeExec *gexec= (bNodeTreeExec*)nodedata;