[FFmpeg-devel] [PATCH] lavfi/tile: do not leak input frame

Paul B Mahol onemda at gmail.com
Thu Aug 22 22:38:20 CEST 2013


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavfilter/vf_tile.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c
index fb3ac85..910a9fc 100644
--- a/libavfilter/vf_tile.c
+++ b/libavfilter/vf_tile.c
@@ -172,8 +172,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
 
     if (!tile->current) {
         tile->out_ref = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!tile->out_ref)
+        if (!tile->out_ref) {
+            av_frame_free(&picref);
             return AVERROR(ENOMEM);
+        }
         av_frame_copy_props(tile->out_ref, picref);
         tile->out_ref->width  = outlink->w;
         tile->out_ref->height = outlink->h;
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list