diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-28 03:18:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-28 04:15:18 +0100 |
commit | e0b187e7dada3a412c942d2e07f6caed8614b8ef (patch) | |
tree | b26d329ab309e3ed723aac59c73e14969ccf4793 | |
parent | 02bd02da5f90536c676ad6d987a980c5a04dca2f (diff) | |
download | ffmpeg-e0b187e7dada3a412c942d2e07f6caed8614b8ef.tar.gz |
avcodec/h264: Fix memleak in case of ff_h264_decode_extradata() failure
Fixes Ticket5139
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/h264.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 2361660327..28b14cd6a0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -52,6 +52,8 @@ #include "thread.h" #include "vdpau_compat.h" +static int h264_decode_end(AVCodecContext *avctx); + const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 }; int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx) @@ -679,7 +681,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) if (avctx->extradata_size > 0 && avctx->extradata) { ret = ff_h264_decode_extradata(h, avctx->extradata, avctx->extradata_size); if (ret < 0) { - ff_h264_free_context(h); + h264_decode_end(avctx); return ret; } } |