diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-10-06 14:28:09 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-10-06 14:28:09 +0400 |
commit | 46a1d921f10445da80c9a2398cfe57d0f4553533 (patch) | |
tree | 3f2a722350c9e8c986c73778c47007fbe0ff3dea /source/blender/editors/space_node | |
parent | e9d03296c7cbff8e20a61359d858642126621669 (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')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 6 |
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; |