Commit f1593e4c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/tta: Check init_get_bits8() for failure

Fixes: CID1322319
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cbd3cd8e
...@@ -123,6 +123,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) ...@@ -123,6 +123,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
TTAContext *s = avctx->priv_data; TTAContext *s = avctx->priv_data;
GetBitContext gb; GetBitContext gb;
int total_frames; int total_frames;
int ret;
s->avctx = avctx; s->avctx = avctx;
...@@ -131,7 +132,10 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) ...@@ -131,7 +132,10 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
s->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); 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")) { if (show_bits_long(&gb, 32) == AV_RL32("TTA1")) {
/* signature */ /* signature */
skip_bits_long(&gb, 32); skip_bits_long(&gb, 32);
......
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