avfilter/vf_lenscorrection: fix memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-21 12:16:07 +02:00
parent f5ddce0753
commit b09ea25fec

View File

@ -111,6 +111,16 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static av_cold void uninit(AVFilterContext *ctx)
{
LenscorrectionCtx *rect = ctx->priv;
int i;
for (i = 0; i < FF_ARRAY_ELEMS(rect->correction); i++) {
av_freep(&rect->correction[i]);
}
}
static int config_props(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@ -214,5 +224,6 @@ AVFilter ff_vf_lenscorrection = {
.inputs = lenscorrection_inputs,
.outputs = lenscorrection_outputs,
.priv_class = &lenscorrection_class,
.uninit = uninit,
.flags = AVFILTER_FLAG_SLICE_THREADS,
};