Commit 309a931a authored by Dale Curtis's avatar Dale Curtis Committed by Michael Niedermayer

Fix memory leaks on failed ff_h264_decode_init()

During failure conditions ff_h264_decode_init() leaks memory
allocated for nal units.  Found via valgrind.

Valgrind traces: http://pastebin.com/GqTqxs8TSigned-off-by: 's avatarDale Curtis <dalecurtis@chromium.org>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ca4a3f4a
...@@ -1251,8 +1251,10 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) ...@@ -1251,8 +1251,10 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
} }
if (avctx->extradata_size > 0 && avctx->extradata && if (avctx->extradata_size > 0 && avctx->extradata &&
ff_h264_decode_extradata(h, avctx->extradata, avctx->extradata_size) < 0) ff_h264_decode_extradata(h, avctx->extradata, avctx->extradata_size) < 0) {
ff_h264_free_context(h);
return -1; return -1;
}
if (h->sps.bitstream_restriction_flag && if (h->sps.bitstream_restriction_flag &&
s->avctx->has_b_frames < h->sps.num_reorder_frames) { s->avctx->has_b_frames < h->sps.num_reorder_frames) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment