[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57139] trunk/blender/source/blender: Fix #35570, old group nodes with empty socket name strings crash.
Lukas Toenne
lukas.toenne at googlemail.com
Thu May 30 13:51:21 CEST 2013
Revision: 57139
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57139
Author: lukastoenne
Date: 2013-05-30 11:51:21 +0000 (Thu, 30 May 2013)
Log Message:
-----------
Fix #35570, old group nodes with empty socket name strings crash. The identifier assignment was not taking potentially empty name strings into account. In addition some of the BLI_uniquename calls were
not passing a valid defname parameter, also crashing.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/node.c
trunk/blender/source/blender/blenloader/intern/readfile.c
Modified: trunk/blender/source/blender/blenkernel/intern/node.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/node.c 2013-05-30 11:37:53 UTC (rev 57138)
+++ trunk/blender/source/blender/blenkernel/intern/node.c 2013-05-30 11:51:21 UTC (rev 57139)
@@ -475,7 +475,7 @@
BLI_strncpy(auto_identifier, name, sizeof(auto_identifier));
}
/* make the identifier unique */
- BLI_uniquename_cb(unique_identifier_check, lb, NULL, '.', auto_identifier, sizeof(auto_identifier));
+ BLI_uniquename_cb(unique_identifier_check, lb, "socket", '.', auto_identifier, sizeof(auto_identifier));
sock = MEM_callocN(sizeof(bNodeSocket), "sock");
sock->in_out = in_out;
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2013-05-30 11:37:53 UTC (rev 57138)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2013-05-30 11:51:21 UTC (rev 57139)
@@ -7770,20 +7770,20 @@
for (node=ntree->nodes.first; node; node=node->next) {
for (sock = node->inputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
- BLI_uniquename(&node->inputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+ BLI_uniquename(&node->inputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
}
for (sock = node->outputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
- BLI_uniquename(&node->outputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+ BLI_uniquename(&node->outputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
}
}
for (sock = ntree->inputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
- BLI_uniquename(&ntree->inputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+ BLI_uniquename(&ntree->inputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
}
for (sock = ntree->outputs.first; sock; sock = sock->next) {
BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
- BLI_uniquename(&ntree->outputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+ BLI_uniquename(&ntree->outputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
}
}
}
More information about the Bf-blender-cvs
mailing list