History

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

Paul B Mahol committed 4 years ago

Commit f89cd451 parent a0ede3c1 file · +10 −8Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_gblur.c+10−8
@@ -249,11 +249,21 @@ void ff_gblur_init(GBlurContext *s) · 248 unmodified lines
249 ff_gblur_init_x86(s);249 ff_gblur_init_x86(s);
250}250}
251 251
252static av_cold void uninit(AVFilterContext *ctx)
253{
254 GBlurContext *s = ctx->priv;
255
256 av_freep(&s->buffer);
257 av_freep(&s->localbuf);
258}
259
252static int config_input(AVFilterLink *inlink)260static int config_input(AVFilterLink *inlink)
253{261{
254 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);262 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
255 GBlurContext *s = inlink->dst->priv;263 GBlurContext *s = inlink->dst->priv;
256 264
265 uninit(inlink->dst);
266
257 s->depth = desc->comp[0].depth;267 s->depth = desc->comp[0].depth;
258 s->flt = !!(desc->flags & AV_PIX_FMT_FLAG_FLOAT);268 s->flt = !!(desc->flags & AV_PIX_FMT_FLAG_FLOAT);
259 s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);269 s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
@@ -379,14 +389,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 119 unmodified lines
379 return ff_filter_frame(outlink, out);389 return ff_filter_frame(outlink, out);
380}390}
381 391
382static av_cold void uninit(AVFilterContext *ctx)
383{
384 GBlurContext *s = ctx->priv;
385
386 av_freep(&s->buffer);
387 av_freep(&s->localbuf);
388}
389
390static const AVFilterPad gblur_inputs[] = {392static const AVFilterPad gblur_inputs[] = {
391 {393 {
392 .name = "default",394 .name = "default",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t