avcodec/mimic: use av_freep() and reset swap_buf_size
authorPaul B Mahol <onemda@gmail.com>
Fri, 8 Nov 2013 14:23:45 +0000 (14:23 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 8 Nov 2013 19:24:17 +0000 (19:24 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/mimic.c

index a1cb5e7..31d6393 100644 (file)
@@ -116,7 +116,8 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx)
     MimicContext *ctx = avctx->priv_data;
     int i;
 
-    av_free(ctx->swap_buf);
+    av_freep(&ctx->swap_buf);
+    ctx->swap_buf_size = 0;
 
     for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
         if (ctx->frames[i].f)