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 Tönne <lukas.toenne@gmail.com>2014-01-07 13:54:31 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-01-07 13:54:31 +0400
commitebf23b51448e4bc9c67d656093ecc01be882c9d3 (patch)
treea0c0efdcac7fbb1506b44c7e5674f59f4cd43f5e /source/blender/nodes
parent54ebaad377e70d1ee0270304fd5d0fda2103c800 (diff)
Fix T38075, crash from shader node add/replace tree view template.
The sanity check for copying socket default value was using the socket idname for type compatibility checks, which is too strict. Subtypes would not be recognized as copyable, but since only the plain data type is needed below this is all that needs to be checked. That alone would not cause crash (just missing default value copy), but the tree view template was messing with the default_value DNA directly by freeing it in advance, which is not necessary and should be left to blenkernel when freeing the node. Otherwise this would leave the node invalid without a default_value if the copy function bails out.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/intern/node_socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c
index 92d403685d0..a37042c9d70 100644
--- a/source/blender/nodes/intern/node_socket.c
+++ b/source/blender/nodes/intern/node_socket.c
@@ -273,7 +273,7 @@ void node_socket_init_default_value(bNodeSocket *sock)
void node_socket_copy_default_value(bNodeSocket *to, bNodeSocket *from)
{
/* sanity check */
- if (!STREQ(to->idname, from->idname))
+ if (to->type != from->type)
return;
/* make sure both exist */