mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/vf_dblur: fix memory leaks if config_input() is called again
This commit is contained in:
parent
f89cd457ca
commit
9809f318ea
@ -134,11 +134,20 @@ static const enum AVPixelFormat pix_fmts[] = {
|
|||||||
AV_PIX_FMT_NONE
|
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)
|
static int config_input(AVFilterLink *inlink)
|
||||||
{
|
{
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
DBlurContext *s = inlink->dst->priv;
|
DBlurContext *s = inlink->dst->priv;
|
||||||
|
|
||||||
|
uninit(inlink->dst);
|
||||||
|
|
||||||
s->depth = desc->comp[0].depth;
|
s->depth = desc->comp[0].depth;
|
||||||
s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
|
s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
|
||||||
s->planewidth[0] = s->planewidth[3] = inlink->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);
|
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[] = {
|
static const AVFilterPad dblur_inputs[] = {
|
||||||
{
|
{
|
||||||
.name = "default",
|
.name = "default",
|
||||||
|
Loading…
Reference in New Issue
Block a user