Commit 5c1a8d3b authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_idet: factorize av_frame_free(&idet->prev)

Found-by: 's avatarPascal Massimino <pascal.massimino@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e0e33ebe
......@@ -249,6 +249,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
return ff_filter_frame(ctx->outputs[0], picref);
}
av_frame_free(&idet->prev);
if( picref->width != link->w
|| picref->height != link->h
|| picref->format != link->format) {
......@@ -256,13 +258,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
link->dst->inputs[0]->w = picref->width;
link->dst->inputs[0]->h = picref->height;
av_frame_free(&idet->prev);
av_frame_free(&idet->cur );
av_frame_free(&idet->next);
}
if (idet->prev)
av_frame_free(&idet->prev);
idet->prev = idet->cur;
idet->cur = idet->next;
idet->next = picref;
......
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