diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-10-20 14:36:02 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-10-20 14:36:02 +0400 |
commit | 70ba7d02dbb44a20ac6d405d75e81806fc7ce4b5 (patch) | |
tree | 963d9ff665c732fe1573431a447db1e39170174c /source/blender/nodes/intern | |
parent | 36017e2af9a3015876b4f573f00630cdae39c1ac (diff) |
Fix for #28980, could enter infinite loop during node socket verification if dynamic sockets are present.
Note: in this particular bug report the sockets have some faulty flag settings (none of them should be flagged as SOCK_DYNAMIC), needs more info.
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r-- | source/blender/nodes/intern/node_socket.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c index 51e48b84383..74f15af88a2 100644 --- a/source/blender/nodes/intern/node_socket.c +++ b/source/blender/nodes/intern/node_socket.c @@ -405,15 +405,15 @@ static bNodeSocket *verify_socket_template(bNodeTree *ntree, bNode *node, int in static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_out, ListBase *socklist, bNodeSocketTemplate *stemp_first) { - bNodeSocket *sock; + bNodeSocket *sock, *nextsock; bNodeSocketTemplate *stemp; /* no inputs anymore? */ if(stemp_first==NULL) { - while(socklist->first) { - sock = (bNodeSocket*)socklist->first; + for (sock = (bNodeSocket*)socklist->first; sock; sock=nextsock) { + nextsock = sock->next; if (!(sock->flag & SOCK_DYNAMIC)) - nodeRemoveSocket(ntree, node, socklist->first); + nodeRemoveSocket(ntree, node, sock); } } else { @@ -424,10 +424,10 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou stemp++; } /* leftovers are removed */ - while(socklist->first) { - sock = (bNodeSocket*)socklist->first; + for (sock = (bNodeSocket*)socklist->first; sock; sock=nextsock) { + nextsock = sock->next; if (!(sock->flag & SOCK_DYNAMIC)) - nodeRemoveSocket(ntree, node, socklist->first); + nodeRemoveSocket(ntree, node, sock); } /* and we put back the verified sockets */ |