Fix [#21826] Memory Map growing in size on each render
authorMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 07:00:59 +0000 (07:00 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 07:00:59 +0000 (07:00 +0000)
Image node wasn't properly getting marked to free compbuf data when using premul.

source/blender/nodes/intern/CMP_nodes/CMP_image.c

index f53e3d2ba8f2367004c24547cc8c0a2fda2a635f..0bbf9c9bf854f29454e6407b6c6e35b7de3b9ac7 100644 (file)
@@ -231,9 +231,12 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **in, b
                                        /*first duplicate stackbuf->rect, since it's just a pointer
                                          to the source imbuf, and we don't want to change that.*/
                                        stackbuf->rect = MEM_dupallocN(stackbuf->rect);
-                               
+                                       
+                                       /* since stackbuf now has allocated memory, rather than just a pointer,
+                                        * mark it as allocated so it can be freed properly */
+                                       stackbuf->malloc=1;
+                                       
                                        /*premul the image*/
-                               
                                        pixel = stackbuf->rect;
                                        for (i=0; i<stackbuf->x*stackbuf->y; i++, pixel += 4) {
                                                pixel[0] *= pixel[3];