ffmpeg | branch: master | Dale Curtis <dalecur...@chromium.org> | Tue Dec  2 
16:47:55 2014 +0000| [56de2897a68e3a8795b0b3c593dad1c5832696e0] | committer: 
Vittorio Giovara

h264: Fix memory leak on ff_h264_decode_init() failure

CC: libav-de...@libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56de2897a68e3a8795b0b3c593dad1c5832696e0
---

 libavcodec/h264.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a392054..cb29d36 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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 &&

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to