[FFmpeg-cvslog] avcodec/dct: use av_freep(), do not leave stale pointers in memory

Michael Niedermayer git at videolan.org
Sat Oct 11 22:56:45 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 11 22:50:51 2014 +0200| [e24e5986a6f5bd9dc2e65306d7969d3ea7dab7a5] | committer: Michael Niedermayer

avcodec/dct: use av_freep(), do not leave stale pointers in memory

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

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

 libavcodec/dct.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 26b4851..9cabc4f 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);
 }



More information about the ffmpeg-cvslog mailing list