]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/tta: Check init_get_bits8() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 23:18:13 +0000 (01:18 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 23:28:25 +0000 (01:28 +0200)
Fixes: CID1322319
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/tta.c

index 273938f194cc9d8aff902cc865cfc11ca252a1f6..1e2e9c4ef4c44619cfa6d2e9313146ea818d87d1 100644 (file)
@@ -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);