[gegl] ff-load: fix memory leak; reuse allocated frame



commit 43839eab3f7b49dae364d938c6c87e86ef0c72dd
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Dec 3 19:34:38 2015 +0100

    ff-load: fix memory leak; reuse allocated frame

 operations/external/ff-load.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index 404aadb..1425775 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -706,7 +706,8 @@ process (GeglOperation       *operation,
           img_convert_ctx = sws_getContext(p->width, p->height, p->video_stream->codec->pix_fmt,
                                            p->width, p->height, AV_PIX_FMT_RGB24,
                                            SWS_BICUBIC, NULL, NULL, NULL);
-          p->rgb_frame = alloc_picture (AV_PIX_FMT_RGB24, p->width, p->height);
+          if (!p->rgb_frame)
+            p->rgb_frame = alloc_picture (AV_PIX_FMT_RGB24, p->width, p->height);
           sws_scale (img_convert_ctx, (void*)p->lavc_frame->data,
                      p->lavc_frame->linesize, 0, p->height, p->rgb_frame->data, p->rgb_frame->linesize);
           gegl_buffer_set (output, &extent, 0, babl_format("R'G'B' u8"), p->rgb_frame->data[0], 
GEGL_AUTO_ROWSTRIDE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]