Commit 0f9f24c9 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_yadif: fix filtering a single image

Found-by: wm4
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e881a966
...@@ -325,8 +325,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) ...@@ -325,8 +325,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
yadif->cur = yadif->next; yadif->cur = yadif->next;
yadif->next = frame; yadif->next = frame;
if (!yadif->cur) if (!yadif->cur &&
return 0; !(yadif->cur = av_frame_clone(yadif->next)))
return AVERROR(ENOMEM);
if (checkstride(yadif, yadif->next, yadif->cur)) { if (checkstride(yadif, yadif->next, yadif->cur)) {
av_log(ctx, AV_LOG_VERBOSE, "Reallocating frame due to differing stride\n"); 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) ...@@ -352,9 +353,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
return ff_filter_frame(ctx->outputs[0], yadif->out); return ff_filter_frame(ctx->outputs[0], yadif->out);
} }
if (!yadif->prev && if (!yadif->prev)
!(yadif->prev = av_frame_clone(yadif->cur))) return 0;
return AVERROR(ENOMEM);
yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h); yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h);
if (!yadif->out) if (!yadif->out)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment