avcodec/eatgq: Check init_get_bits8() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 09:53:38 +0000 (11:53 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 10:03:44 +0000 (12:03 +0200)
Fixes CID1322315

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/eatgq.c

index d86cc7b..f8a47cb 100644 (file)
@@ -157,7 +157,10 @@ static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)
     mode = bytestream2_get_byte(&s->gb);
     if (mode > 12) {
         GetBitContext gb;
-        init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));
+        int ret = init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));
+        if (ret < 0)
+            return ret;
+
         for (i = 0; i < 6; i++)
             tgq_decode_block(s, s->block[i], &gb);
         tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);