h264: Fix memory leak on ff_h264_decode_init() failure
authorDale Curtis <dalecurtis@chromium.org>
Tue, 2 Dec 2014 16:47:55 +0000 (16:47 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 3 Dec 2014 02:51:18 +0000 (02:51 +0000)
CC: libav-devel@libav.org
libavcodec/h264.c

index a392054..cb29d36 100644 (file)
@@ -662,8 +662,10 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
 
     if (avctx->extradata_size > 0 && avctx->extradata) {
        ret = ff_h264_decode_extradata(h);
-       if (ret < 0)
+       if (ret < 0) {
+           ff_h264_free_context(h);
            return ret;
+       }
     }
 
     if (h->sps.bitstream_restriction_flag &&