[FFmpeg-cvslog] avfilter/vf_lenscorrection: fix memleak

Michael Niedermayer git at videolan.org
Thu Aug 21 13:45:35 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 21 12:16:07 2014 +0200| [b09ea25fec615c871ab8bfb00c3863aa0ce0d2c9] | committer: Michael Niedermayer

avfilter/vf_lenscorrection: fix memleak

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b09ea25fec615c871ab8bfb00c3863aa0ce0d2c9
---

 libavfilter/vf_lenscorrection.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index d30a81b..58184b0 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -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,
 };



More information about the ffmpeg-cvslog mailing list