Fix #32795: Memory leak when rendering to video file
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 8 Oct 2012 12:58:37 +0000 (12:58 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 8 Oct 2012 12:58:37 +0000 (12:58 +0000)
source/blender/render/intern/source/pipeline.c

index b64a6b85ef7d8762f16b6d9af52af44e6749c569..1859de0039d4c09220b64484c1e135a87e05947a 100644 (file)
@@ -2117,6 +2117,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
                /* note; the way it gets 32 bits rects is weak... */
                if (ibuf->rect == NULL) {
                        ibuf->rect = MEM_mapallocN(sizeof(int) * rres.rectx * rres.recty, "temp 32 bits rect");
+                       ibuf->mall |= IB_rect;
                        RE_ResultGet32(re, ibuf->rect);
                        do_free = TRUE;
                }
@@ -2130,6 +2131,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
                if (do_free) {
                        MEM_freeN(ibuf->rect);
                        ibuf->rect = NULL;
+                       ibuf->mall &= ~IB_rect;
                }
 
                /* imbuf knows which rects are not part of ibuf */