Fix T76277: Remove wrong cast in rna_NodeTree_update

This patch fixes T76277 by removing the incorrect cast from
`ptr->data` to `bNode`. The address of `ptr->owner_id` and
`ptr->data` both point to the node tree. Passing the node tree
incorrectly as a node into the `ED_node_tag_update_nodetree`
corrupts the data, because it attempts to set flags on the
node.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7747
This commit is contained in:
Robert Guetzkow 2020-05-15 18:17:38 +02:00
parent 9632a06201
commit 001d70eb2b
Notes: blender-bot 2023-02-14 06:00:49 +01:00
Referenced by issue #76277, Enabling Viewer Border in Compositor Crashes Blender
1 changed files with 1 additions and 2 deletions

View File

@ -862,12 +862,11 @@ static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports)
static void rna_NodeTree_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
WM_main_add_notifier(NC_SCENE | ND_NODES, &ntree->id);
ED_node_tag_update_nodetree(bmain, ntree, node);
ED_node_tag_update_nodetree(bmain, ntree, NULL);
}
static bNode *rna_NodeTree_node_new(bNodeTree *ntree,