From 9387d46772e3abcd9cfff611008b611a18ca05a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Sep 2010 14:13:34 +0000 Subject: bugfix [#23948] Alpha from images inside compositor is gone also fix memory leak. --- source/blender/nodes/intern/CMP_nodes/CMP_image.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/nodes/intern/CMP_nodes') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index 266060c5cc5..9309d2939db 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -82,7 +82,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i rect= ibuf->rect_float; } else { - rect= MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); alloc= TRUE; } @@ -92,7 +92,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i rect= ibuf->rect_float; } else { - rect= MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); alloc= TRUE; } @@ -109,8 +109,9 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i } else { /* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */ - stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, alloc); + stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, FALSE); stackbuf->rect= rect; + stackbuf->malloc= alloc; } /*code to respect the premul flag of images; I'm -- cgit v1.2.3