1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

h264: Fix memory leak on ff_h264_decode_init() failure

CC: libav-devel@libav.org
This commit is contained in:
Dale Curtis
2014-12-02 16:47:55 +00:00
committed by Vittorio Giovara
parent 2e0935965b
commit 56de2897a6

View File

@@ -662,9 +662,11 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
if (avctx->extradata_size > 0 && avctx->extradata) { if (avctx->extradata_size > 0 && avctx->extradata) {
ret = ff_h264_decode_extradata(h); ret = ff_h264_decode_extradata(h);
if (ret < 0) if (ret < 0) {
ff_h264_free_context(h);
return ret; return ret;
} }
}
if (h->sps.bitstream_restriction_flag && if (h->sps.bitstream_restriction_flag &&
h->avctx->has_b_frames < h->sps.num_reorder_frames) { h->avctx->has_b_frames < h->sps.num_reorder_frames) {