diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-02 02:08:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-02 02:33:24 +0200 |
commit | 0f9f24c9cfd291c7ece4d3bad64fdf06d107168a (patch) | |
tree | e62d12c7a6995af48b7407c3a7e1dd20d6ae9d8a /libavfilter/vf_yadif.c | |
parent | e881a9663216bbce4e105cbe2569ef1cc50bb10b (diff) | |
download | ffmpeg-streaming-0f9f24c9cfd291c7ece4d3bad64fdf06d107168a.zip ffmpeg-streaming-0f9f24c9cfd291c7ece4d3bad64fdf06d107168a.tar.gz |
avfilter/vf_yadif: fix filtering a single image
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_yadif.c')
-rw-r--r-- | libavfilter/vf_yadif.c | 10 |
1 files 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) |