diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 01:18:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-12 02:55:46 +0100 |
commit | 1e7ff902f2f57b62e9db4fa0e5f24780d3140fa5 (patch) | |
tree | 25810f00489d7ff588c93e580539cf245e5f5f31 | |
parent | dceec28eac8a8a8190c98d8ba73ed3e6989cf762 (diff) | |
download | ffmpeg-1e7ff902f2f57b62e9db4fa0e5f24780d3140fa5.tar.gz |
avcodec/tta: Check init_get_bits8() for failure
Fixes: CID1322319
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f1593e4ca564cdb7f3194a9eee1dea16df41142d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/tta.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 01584d957e..81f5dddf69 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -123,6 +123,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) TTAContext *s = avctx->priv_data; GetBitContext gb; int total_frames; + int ret; s->avctx = avctx; @@ -131,7 +132,10 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) return AVERROR_INVALIDDATA; s->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); - init_get_bits8(&gb, avctx->extradata, avctx->extradata_size); + ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size); + if (ret < 0) + return ret; + if (show_bits_long(&gb, 32) == AV_RL32("TTA1")) { /* signature */ skip_bits_long(&gb, 32); |