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

Michael Niedermayer git at videolan.org
Tue Oct 7 03:49:08 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct  7 03:40:57 2014 +0200| [f0d1b3acdfb8fc61005d19d13350b7fa1bd19a6f] | committer: Michael Niedermayer

avcodec/escape124: 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=f0d1b3acdfb8fc61005d19d13350b7fa1bd19a6f
---

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

diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index bed1efb..c7ccf22 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -76,7 +76,7 @@ static av_cold int escape124_decode_close(AVCodecContext *avctx)
     Escape124Context *s = avctx->priv_data;
 
     for (i = 0; i < 3; i++)
-        av_free(s->codebooks[i].blocks);
+        av_freep(&s->codebooks[i].blocks);
 
     av_frame_free(&s->frame);
 
@@ -263,7 +263,7 @@ static int escape124_decode_frame(AVCodecContext *avctx,
                     cb_size = s->num_superblocks << cb_depth;
                 }
             }
-            av_free(s->codebooks[i].blocks);
+            av_freep(&s->codebooks[i].blocks);
             s->codebooks[i] = unpack_codebook(&gb, cb_depth, cb_size);
             if (!s->codebooks[i].blocks)
                 return -1;



More information about the ffmpeg-cvslog mailing list