From ebf23b51448e4bc9c67d656093ecc01be882c9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Tue, 7 Jan 2014 10:54:31 +0100 Subject: 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. --- source/blender/nodes/intern/node_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/nodes') 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 */ -- cgit v1.2.3