libavcodec/eamad.c:133: error: Integer Overflow L2
  ([1, +oo] - 8):unsigned32 by call to `bitstream_read_signed`.

libavcodec/eamad.c:133:23: Call
131.     int16_t *quant_matrix = s->quant_matrix;
132. 
133.     block[0] = (128 + bitstream_read_signed(&s->bc, 8)) * quant_matrix[0];
                           ^
134. 
135.     /* The RL decoder is derived from mpeg1_decode_block_intra;

libavcodec/bitstream.h:199:1: Parameter `n`
  197. /* Return n bits from the buffer as a signed integer.
  198.  * n has to be in the 0-32 range. */
  199. static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)
       ^
  200. {
  201.     return sign_extend(bitstream_read(bc, n), n);

libavcodec/bitstream.h:201:24: Call
  199. static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)
  200. {
  201.     return sign_extend(bitstream_read(bc, n), n);
                              ^
  202. }
  203. 

libavcodec/bitstream.h:183:1: Parameter `n`
    181. 
    182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
    183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
         ^
    184. {
    185.     if (!n)

libavcodec/bitstream.h:194:12: Call
    192.     }
    193. 
    194.     return get_val(bc, n);
                    ^
    195. }
    196. 

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: ([1, +oo] - 8):unsigned32 by call to `bitstream_read_signed` 
      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 inline void decode_block_intra(MadContext *s, int16_t * block)\n{\n    int level, i, j, run;\n    RLTable *rl = &ff_rl_mpeg1;\n    const uint8_t *scantable = s->scantable.permutated;\n    int16_t *quant_matrix = s->quant_matrix;\n    block[0] = (128 + bitstream_read_signed(&s->bc, 8)) * quant_matrix[0];\n    i = 0;\n    {\n        for (;;) {\n            BITSTREAM_RL_VLC(level, run, &s->bc, rl->rl_vlc[0], TEX_VLC_BITS, 2);\n            if (level == 127) {\n                break;\n            } else if (level != 0) {\n                i += run;\n                if (i > 63) {\n                    av_log(s->avctx, AV_LOG_ERROR,\n                           "ac-tex damaged at %d %d\\n", s->mb_x, s->mb_y);\n                    return;\n                }\n                j = scantable[i];\n                level = (level*quant_matrix[j]) >> 4;\n                level = (level-1)|1;\n                level = bitstream_apply_sign(&s->bc, level);\n            } else {\n                level = bitstream_read_signed(&s->bc, 10);\n                run = bitstream_read(&s->bc, 6) + 1;\n                i += run;\n                if (i > 63) {\n                    av_log(s->avctx, AV_LOG_ERROR,\n                           "ac-tex damaged at %d %d\\n", s->mb_x, s->mb_y);\n                    return;\n                }\n                j = scantable[i];\n                if (level < 0) {\n                    level = -level;\n                    level = (level*quant_matrix[j]) >> 4;\n                    level = (level-1)|1;\n                    level = -level;\n                } else {\n                    level = (level*quant_matrix[j]) >> 4;\n                    level = (level-1)|1;\n                }\n            }\n            block[j] = level;\n        }\n    }\n}', 'static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)\n{\n    return sign_extend(bitstream_read(bc, n), n);\n}', 'static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)\n{\n    if (!n)\n        return 0;\n    if (n > bc->bits_left) {\n        refill_32(bc);\n        if (bc->bits_left < 32)\n            bc->bits_left = n;\n    }\n    return get_val(bc, n);\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}']