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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-10-06 14:28:09 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-10-06 14:28:09 +0400
commit46a1d921f10445da80c9a2398cfe57d0f4553533 (patch)
tree3f2a722350c9e8c986c73778c47007fbe0ff3dea /source/blender/editors/space_node/node_edit.c
parente9d03296c7cbff8e20a61359d858642126621669 (diff)
Fix for Output File node operators: added a sanity type check to avoid using invalid node data.
Reported by Sebastian Koenig in unrelated bug report #36968.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r--source/blender/editors/space_node/node_edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index ff6a8e884a6..bc0a518b1b0 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1731,7 +1731,7 @@ static int node_output_file_add_socket_exec(bContext *C, wmOperator *op)
node = nodeGetActive(snode->edittree);
}
- if (!node)
+ if (!node || node->type != CMP_NODE_OUTPUT_FILE)
return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "file_path", file_path);
@@ -1777,7 +1777,7 @@ static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator *U
node = nodeGetActive(snode->edittree);
}
- if (!node)
+ if (!node || node->type != CMP_NODE_OUTPUT_FILE)
return OPERATOR_CANCELLED;
if (!ntreeCompositOutputFileRemoveActiveSocket(ntree, node))
@@ -1819,7 +1819,7 @@ static int node_output_file_move_active_socket_exec(bContext *C, wmOperator *op)
else if (snode && snode->edittree)
node = nodeGetActive(snode->edittree);
- if (!node)
+ if (!node || node->type != CMP_NODE_OUTPUT_FILE)
return OPERATOR_CANCELLED;
nimf = node->storage;