aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2014-12-02 16:47:55 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-12-03 02:51:18 +0000
commit56de2897a68e3a8795b0b3c593dad1c5832696e0 (patch)
tree4860614e13f532c293442ebb506a8a23cbb943a3
parent2e0935965b824bc641b7e0bafafcbb1e36027f79 (diff)
downloadffmpeg-56de2897a68e3a8795b0b3c593dad1c5832696e0.tar.gz
h264: Fix memory leak on ff_h264_decode_init() failure
CC: libav-devel@libav.org
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a3920543e4..cb29d3621b 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 &&