avfilter/vf_dctdnoiz: use av_freep() to avoid leaving stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Dec 2014 14:56:32 +0000 (15:56 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Dec 2014 14:56:32 +0000 (15:56 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_dctdnoiz.c

index a9017b1..5cce9cb 100644 (file)
@@ -732,14 +732,14 @@ static av_cold void uninit(AVFilterContext *ctx)
     int i;
     DCTdnoizContext *s = ctx->priv;
 
-    av_free(s->weights);
+    av_freep(&s->weights);
     for (i = 0; i < 2; i++) {
-        av_free(s->cbuf[i][0]);
-        av_free(s->cbuf[i][1]);
-        av_free(s->cbuf[i][2]);
+        av_freep(&s->cbuf[i][0]);
+        av_freep(&s->cbuf[i][1]);
+        av_freep(&s->cbuf[i][2]);
     }
     for (i = 0; i < s->nb_threads; i++) {
-        av_free(s->slices[i]);
+        av_freep(&s->slices[i]);
         av_expr_free(s->expr[i]);
     }
 }