avcodec/mjpegenc: use av_freep(), avoid leaving stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 31 Oct 2014 12:36:19 +0000 (13:36 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 31 Oct 2014 12:36:19 +0000 (13:36 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegenc.c

index 0fb3a17..14701e2 100644 (file)
@@ -78,7 +78,7 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
 
 void ff_mjpeg_encode_close(MpegEncContext *s)
 {
-    av_free(s->mjpeg_ctx);
+    av_freep(&s->mjpeg_ctx);
 }
 
 static void encode_block(MpegEncContext *s, int16_t *block, int n)