diff --git a/libavfilter/vf_separatefields.c b/libavfilter/vf_separatefields.c index d9c4839630..8fce6de060 100644 --- a/libavfilter/vf_separatefields.c +++ b/libavfilter/vf_separatefields.c @@ -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);