[FFmpeg-cvslog] avfilter/vf_dblur: fix memory leaks if config_input() is called again
Paul B Mahol
git at videolan.org
Thu Feb 10 10:22:59 EET 2022
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Feb 10 09:10:35 2022 +0100| [9809f318ea8812f4185b35d7c5a08899f35e0db0] | committer: Paul B Mahol
avfilter/vf_dblur: fix memory leaks if config_input() is called again
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9809f318ea8812f4185b35d7c5a08899f35e0db0
---
libavfilter/vf_dblur.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/libavfilter/vf_dblur.c b/libavfilter/vf_dblur.c
index e821029906..05beb249b0 100644
--- a/libavfilter/vf_dblur.c
+++ b/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",
More information about the ffmpeg-cvslog
mailing list