avcodec/libvpxenc: use av_freep(), do not leave stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Oct 2014 01:03:04 +0000 (03:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Oct 2014 01:04:04 +0000 (03:04 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libvpxenc.c

index a745acd43723d85d569a77f177e933e9476a4f6a..30940a128d9650b170fb4bbf1d0460e5039e0697 100644 (file)
@@ -763,8 +763,8 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     if (rawimg_alpha) {
-        av_free(rawimg_alpha->planes[VPX_PLANE_U]);
-        av_free(rawimg_alpha->planes[VPX_PLANE_V]);
+        av_freep(&rawimg_alpha->planes[VPX_PLANE_U]);
+        av_freep(&rawimg_alpha->planes[VPX_PLANE_V]);
     }
 
     *got_packet = !!coded_size;