Fix [#21727] texture in compositor quickly results in crash
authorMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 05:44:21 +0000 (05:44 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 05:44:21 +0000 (05:44 +0000)
Hopefully this is correct - looks like the CompBuf->node pointer was getting left
out of the per-thread copying/localisation.

source/blender/blenkernel/intern/node.c
source/blender/nodes/intern/CMP_util.c
source/blender/nodes/intern/CMP_util.h

index 5bd9694e768be1dbcee321aa347d1bd792f8618e..9ff7f1f29822ef3f2e05ad9ccc5697863e452efc 100644 (file)
@@ -2573,6 +2573,8 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
                for(sock= node->outputs.first; sock; sock= sock->next) {
                        
                        sock->new_sock->ns.data= sock->ns.data;
+                       compbuf_set_node(sock->new_sock->ns.data, node->new_node);
+                       
                        sock->ns.data= NULL;
                        sock->new_sock->new_sock= sock;
                }
index 336694a4788eaaa3bc77a391b769eccea3a50571..f66b13a19379a92acedaafa58d54d2f9977fe3bc 100644 (file)
@@ -122,6 +122,11 @@ void print_compbuf(char *str, CompBuf *cbuf)
        
 }
 
+void compbuf_set_node(CompBuf *cbuf, bNode *node)
+{
+       if (cbuf) cbuf->node = node;
+}
+
 /* used for disabling node  (similar code in drawnode.c for disable line) */
 void node_compo_pass_on(bNode *node, bNodeStack **nsin, bNodeStack **nsout)
 {
index 4b6b5551146cb42cdd7251de0b5fa454de1c7a46..9dfea6abf541f0c79ecef4999d7e53c413cc0e02 100644 (file)
@@ -110,6 +110,7 @@ CompBuf *dupalloc_compbuf(CompBuf *cbuf);
 CompBuf *pass_on_compbuf(CompBuf *cbuf);
 void free_compbuf(CompBuf *cbuf);
 void print_compbuf(char *str, CompBuf *cbuf);
+void compbuf_set_node(struct CompBuf *cbuf, struct bNode *node);
 void node_compo_pass_on(struct bNode *node, struct bNodeStack **nsin, struct bNodeStack **nsout);
 
 CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type);