libavcodec/fic.c:182: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `fic_decode_block`.

libavcodec/fic.c:172:5: Call
170.     int x, y, p;
171. 
172.     bitstream_init8(&bc, src, src_size);
         ^
173. 
174.     for (p = 0; p < 3; p++) {

libavcodec/bitstream.h:104:1: Parameter `bc->bits_left`
  102. 
  103. /* Initialize BitstreamContext with buffer size in bytes instead of bits. */
  104. static inline int bitstream_init8(BitstreamContext *bc, const uint8_t *buffer,
       ^
  105.                                   unsigned byte_size)
  106. {

libavcodec/fic.c:182:28: Call
180.                 int ret;
181. 
182.                 if ((ret = fic_decode_block(ctx, &bc, dst + x, stride, tctx->block)) != 0)
                                ^
183.                     return ret;
184.             }

libavcodec/fic.c:132:1: Parameter `bc->bits_left`
  130.     }
  131. }
  132. static int fic_decode_block(FICContext *ctx, BitstreamContext *bc,
       ^
  133.                             uint8_t *dst, int stride, int16_t *block)
  134. {

libavcodec/fic.c:138:9: Call
  136. 
  137.     /* Is it a skip block? */
  138.     if (bitstream_read_bit(bc)) {
               ^
  139.         /* This is a P-frame. */
  140.         ctx->frame->key_frame = 0;

libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
    143. 
    144. /* Return one bit from the buffer. */
    145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
         ^
    146. {
    147.     if (!bc->bits_left)

libavcodec/bitstream.h:150:12: Call
    148.         refill_64(bc);
    149. 
    150.     return get_val(bc, 1);
                    ^
    151. }
    152. 

libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
      128. }
      129. 
      130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
           ^
      131. {
      132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `n`
      128. }
      129. 
      130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
           ^
      131. {
      132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `fic_decode_block` 
      137.     bc->bits <<= n;
      138. #endif
      139.     bc->bits_left -= n;
               ^
      140. 
      141.     return ret;

static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
    bc->bits >>= n;
#else
    uint64_t ret = bc->bits >> (64 - n);
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
    return ret;
}
['static int fic_decode_slice(AVCodecContext *avctx, void *tdata)\n{\n    FICContext *ctx        = avctx->priv_data;\n    FICThreadContext *tctx = tdata;\n    BitstreamContext bc;\n    uint8_t *src = tctx->src;\n    int slice_h  = tctx->slice_h;\n    int src_size = tctx->src_size;\n    int y_off    = tctx->y_off;\n    int x, y, p;\n    bitstream_init8(&bc, src, src_size);\n    for (p = 0; p < 3; p++) {\n        int stride   = ctx->frame->linesize[p];\n        uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride;\n        for (y = 0; y < (slice_h >> !!p); y += 8) {\n            for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) {\n                int ret;\n                if ((ret = fic_decode_block(ctx, &bc, dst + x, stride, tctx->block)) != 0)\n                    return ret;\n            }\n            dst += 8 * stride;\n        }\n    }\n    return 0;\n}', 'static inline int bitstream_init8(BitstreamContext *bc, const uint8_t *buffer,\n                                  unsigned byte_size)\n{\n    if (byte_size > INT_MAX / 8)\n        return AVERROR_INVALIDDATA;\n    return bitstream_init(bc, buffer, byte_size * 8);\n}', 'static int fic_decode_block(FICContext *ctx, BitstreamContext *bc,\n                            uint8_t *dst, int stride, int16_t *block)\n{\n    int i, num_coeff;\n    if (bitstream_read_bit(bc)) {\n        ctx->frame->key_frame = 0;\n        ctx->frame->pict_type = AV_PICTURE_TYPE_P;\n        return 0;\n    }\n    memset(block, 0, sizeof(*block) * 64);\n    num_coeff = bitstream_read(bc, 7);\n    if (num_coeff > 64)\n        return AVERROR_INVALIDDATA;\n    for (i = 0; i < num_coeff; i++)\n        block[ff_zigzag_direct[i]] = get_se_golomb(bc) *\n                                     ctx->qmat[ff_zigzag_direct[i]];\n    fic_idct_put(dst, stride, block);\n    return 0;\n}', 'static inline unsigned bitstream_read_bit(BitstreamContext *bc)\n{\n    if (!bc->bits_left)\n        refill_64(bc);\n    return get_val(bc, 1);\n}', 'static inline uint64_t get_val(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);\n    bc->bits >>= n;\n#else\n    uint64_t ret = bc->bits >> (64 - n);\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n    return ret;\n}']