[FFmpeg-cvslog] avfilter/vf_yadif: fix filtering a single image

Michael Niedermayer git at videolan.org
Fri May 2 02:35:12 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May  2 02:08:19 2014 +0200| [0f9f24c9cfd291c7ece4d3bad64fdf06d107168a] | committer: Michael Niedermayer

avfilter/vf_yadif: fix filtering a single image

Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f9f24c9cfd291c7ece4d3bad64fdf06d107168a
---

 libavfilter/vf_yadif.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 9427994..22a28be 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -325,8 +325,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
     yadif->cur  = yadif->next;
     yadif->next = frame;
 
-    if (!yadif->cur)
-        return 0;
+    if (!yadif->cur &&
+        !(yadif->cur = av_frame_clone(yadif->next)))
+        return AVERROR(ENOMEM);
 
     if (checkstride(yadif, yadif->next, yadif->cur)) {
         av_log(ctx, AV_LOG_VERBOSE, "Reallocating frame due to differing stride\n");
@@ -352,9 +353,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
         return ff_filter_frame(ctx->outputs[0], yadif->out);
     }
 
-    if (!yadif->prev &&
-        !(yadif->prev = av_frame_clone(yadif->cur)))
-        return AVERROR(ENOMEM);
+    if (!yadif->prev)
+        return 0;
 
     yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h);
     if (!yadif->out)



More information about the ffmpeg-cvslog mailing list