lavfi/separatefields: fix frame leak
authorPaul B Mahol <onemda@gmail.com>
Wed, 21 Aug 2013 20:02:25 +0000 (20:02 +0000)
committerPaul B Mahol <onemda@gmail.com>
Wed, 21 Aug 2013 20:02:25 +0000 (20:02 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_separatefields.c

index d9c4839..8fce6de 100644 (file)
@@ -77,8 +77,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
 
     inpicref->pts = outlink->frame_count * sf->ts_unit;
     ret = ff_filter_frame(outlink, inpicref);
-    if (ret < 0)
+    if (ret < 0) {
+        av_frame_free(&second);
         return ret;
+    }
 
     second->pts = outlink->frame_count * sf->ts_unit;
     return ff_filter_frame(outlink, second);