Fix #32795: Memory leak when rendering to video file

This commit is contained in:
Sergey Sharybin
2012-10-08 12:58:37 +00:00
parent 6a82b985c3
commit 4a5f09fc65

View 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 */