From e24e5986a6f5bd9dc2e65306d7969d3ea7dab7a5 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 11 Oct 2014 22:50:51 +0200
Subject: [PATCH] avcodec/dct: use av_freep(), do not leave stale pointers in
 memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavcodec/dct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 26b485106d2..9cabc4f5915 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -193,7 +193,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
         s->csc2   = av_malloc_array(n / 2, sizeof(FFTSample));
 
         if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
-            av_free(s->csc2);
+            av_freep(&s->csc2);
             return -1;
         }
 
@@ -218,5 +218,5 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
 av_cold void ff_dct_end(DCTContext *s)
 {
     ff_rdft_end(&s->rdft);
-    av_free(s->csc2);
+    av_freep(&s->csc2);
 }
-- 
GitLab