Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-23 12:02:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-23 12:02:29 +0400
commit176e45f88ec1b6e4068c4ed11a3f3821a0d7d794 (patch)
treec29f3714fb7103d665d9dd57def89d9b453f9da2 /source/blender/blenkernel/intern/node.c
parent7faa531a627b3010f614114531f0f54c12553cf1 (diff)
fix for possible (but unlikely) crash.
added NULL check in case nodeAddNodeType() is given an invalid type or the dynamic node cant be found.
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index fed982a8f1d..b8b57b6bac0 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -967,6 +967,11 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id)
} else
ntype= node_get_type(ntree, type, id);
+ if(ntype == NULL) {
+ printf("nodeAddNodeType() error: '%d' type invalid\n", type);
+ return NULL;
+ }
+
node= MEM_callocN(sizeof(bNode), "new node");
BLI_addtail(&ntree->nodes, node);
node->typeinfo= ntype;