avfilter/vf_dblur: fix memory leaks if config_input() is called again

release/5.1
Paul B Mahol 3 years ago
parent f89cd457ca
commit 9809f318ea
  1. 16
      libavfilter/vf_dblur.c

@ -134,11 +134,20 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_NONE
};
static av_cold void uninit(AVFilterContext *ctx)
{
DBlurContext *s = ctx->priv;
av_freep(&s->buffer);
}
static int config_input(AVFilterLink *inlink)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
DBlurContext *s = inlink->dst->priv;
uninit(inlink->dst);
s->depth = desc->comp[0].depth;
s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[0] = s->planewidth[3] = inlink->w;
@ -262,13 +271,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, out);
}
static av_cold void uninit(AVFilterContext *ctx)
{
DBlurContext *s = ctx->priv;
av_freep(&s->buffer);
}
static const AVFilterPad dblur_inputs[] = {
{
.name = "default",

Loading…
Cancel
Save