libavcodec/alsdec.c:1131: error: Integer Overflow L2
  ([-3, +oo] - 5):unsigned32 by call to `read_decode_block`.

libavcodec/alsdec.c:1082:1: Parameter `ctx->bc.bits_left`
1080. /** Decode blocks dependently.
1081.  */
1082. static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
      ^
1083.                          unsigned int c, const unsigned int *div_blocks,
1084.                          unsigned int *js_blocks)

libavcodec/alsdec.c:1131:20: Call
1129.         bd[1].raw_other    = bd[0].raw_samples;
1130. 
1131.         if ((ret = read_decode_block(ctx, &bd[0])) < 0 ||
                         ^
1132.             (ret = read_decode_block(ctx, &bd[1])) < 0)
1133.             goto fail;

libavcodec/alsdec.c:1013:1: Parameter `ctx->bc.bits_left`
  1011. /** Read and decode block data successively.
  1012.  */
  1013. static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
        ^
  1014. {
  1015.     int ret;

libavcodec/alsdec.c:1017:16: Call
  1015.     int ret;
  1016. 
  1017.     if ((ret = read_block(ctx, bd)) < 0)
                       ^
  1018.         return ret;
  1019. 

libavcodec/alsdec.c:968:1: Parameter `ctx->bc.bits_left`
    966. /** Read the block data.
    967.  */
    968. static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
         ^
    969. {
    970.     int ret = 0;

libavcodec/alsdec.c:975:9: Call
    973.     *bd->shift_lsbs = 0;
    974.     // read block type flag and read the samples accordingly
    975.     if (bitstream_read_bit(bc)) {
                 ^
    976.         ret = read_var_block_data(ctx, bd);
    977.     } else {

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

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

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

libavcodec/bitstream.h:138:5: Assignment
        136.     bc->bits <<= n;
        137. #endif
        138.     bc->bits_left -= n;
                 ^
        139. 
        140.     return ret;

libavcodec/alsdec.c:978:9: Call
    976.         ret = read_var_block_data(ctx, bd);
    977.     } else {
    978.         read_const_block_data(ctx, bd);
                 ^
    979.     }
    980. 

libavcodec/alsdec.c:557:1: Parameter `ctx->bc.bits_left`
      555. /** Read the block data for a constant block
      556.  */
      557. static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
           ^
      558. {
      559.     ALSSpecificConfig *sconf = &ctx->sconf;

libavcodec/alsdec.c:564:24: Call
      562. 
      563.     *bd->raw_samples = 0;
      564.     *bd->const_block = bitstream_read_bit(bc);  // 1 = constant value, 0 = zero block (silence)
                                  ^
      565.     bd->js_blocks    = bitstream_read_bit(bc);
      566. 

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

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

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

libavcodec/bitstream.h:138:5: Assignment
          136.     bc->bits <<= n;
          137. #endif
          138.     bc->bits_left -= n;
                   ^
          139. 
          140.     return ret;

libavcodec/alsdec.c:565:24: Call
      563.     *bd->raw_samples = 0;
      564.     *bd->const_block = bitstream_read_bit(bc);  // 1 = constant value, 0 = zero block (silence)
      565.     bd->js_blocks    = bitstream_read_bit(bc);
                                  ^
      566. 
      567.     // skip 5 reserved bits

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

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

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

libavcodec/bitstream.h:138:5: Assignment
          136.     bc->bits <<= n;
          137. #endif
          138.     bc->bits_left -= n;
                   ^
          139. 
          140.     return ret;

libavcodec/alsdec.c:568:5: Call
      566. 
      567.     // skip 5 reserved bits
      568.     bitstream_skip(bc, 5);
               ^
      569. 
      570.     if (*bd->const_block) {

libavcodec/bitstream.h:240:1: Parameter `n`
        238. 
        239. /* Skip n bits in the buffer. */
        240. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
             ^
        241. {
        242.     if (n < bc->bits_left)

libavcodec/bitstream.h:243:9: Call
        241. {
        242.     if (n < bc->bits_left)
        243.         skip_remaining(bc, n);
                     ^
        244.     else {
        245.         n -= bc->bits_left;

libavcodec/bitstream.h:229:1: <LHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `bc->bits_left`
          227. }
          228. 
          229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
               ^
          230. {
          231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: <RHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `n`
          227. }
          228. 
          229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
               ^
          230. {
          231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:236:5: Binary operation: ([-3, +oo] - 5):unsigned32 by call to `read_decode_block` 
          234.     bc->bits <<= n;
          235. #endif
          236.     bc->bits_left -= n;
                   ^
          237. }
          238. 

static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    bc->bits >>= n;
#else
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
}
['static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,\n                         unsigned int c, const unsigned int *div_blocks,\n                         unsigned int *js_blocks)\n{\n    ALSSpecificConfig *sconf = &ctx->sconf;\n    unsigned int offset = 0;\n    unsigned int b;\n    int ret;\n    ALSBlockData bd[2] = { { 0 } };\n    bd[0].ra_block         = ra_frame;\n    bd[0].const_block      = ctx->const_block;\n    bd[0].shift_lsbs       = ctx->shift_lsbs;\n    bd[0].opt_order        = ctx->opt_order;\n    bd[0].store_prev_samples = ctx->store_prev_samples;\n    bd[0].use_ltp          = ctx->use_ltp;\n    bd[0].ltp_lag          = ctx->ltp_lag;\n    bd[0].ltp_gain         = ctx->ltp_gain[0];\n    bd[0].quant_cof        = ctx->quant_cof[0];\n    bd[0].lpc_cof          = ctx->lpc_cof[0];\n    bd[0].prev_raw_samples = ctx->prev_raw_samples;\n    bd[0].js_blocks        = *js_blocks;\n    bd[1].ra_block         = ra_frame;\n    bd[1].const_block      = ctx->const_block;\n    bd[1].shift_lsbs       = ctx->shift_lsbs;\n    bd[1].opt_order        = ctx->opt_order;\n    bd[1].store_prev_samples = ctx->store_prev_samples;\n    bd[1].use_ltp          = ctx->use_ltp;\n    bd[1].ltp_lag          = ctx->ltp_lag;\n    bd[1].ltp_gain         = ctx->ltp_gain[0];\n    bd[1].quant_cof        = ctx->quant_cof[0];\n    bd[1].lpc_cof          = ctx->lpc_cof[0];\n    bd[1].prev_raw_samples = ctx->prev_raw_samples;\n    bd[1].js_blocks        = *(js_blocks + 1);\n    for (b = 0; b < ctx->num_blocks; b++) {\n        unsigned int s;\n        bd[0].block_length = div_blocks[b];\n        bd[1].block_length = div_blocks[b];\n        bd[0].raw_samples  = ctx->raw_samples[c    ] + offset;\n        bd[1].raw_samples  = ctx->raw_samples[c + 1] + offset;\n        bd[0].raw_other    = bd[1].raw_samples;\n        bd[1].raw_other    = bd[0].raw_samples;\n        if ((ret = read_decode_block(ctx, &bd[0])) < 0 ||\n            (ret = read_decode_block(ctx, &bd[1])) < 0)\n            goto fail;\n        if (bd[0].js_blocks) {\n            if (bd[1].js_blocks)\n                av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel pair!\\n");\n            for (s = 0; s < div_blocks[b]; s++)\n                bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s];\n        } else if (bd[1].js_blocks) {\n            for (s = 0; s < div_blocks[b]; s++)\n                bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s];\n        }\n        offset  += div_blocks[b];\n        bd[0].ra_block = 0;\n        bd[1].ra_block = 0;\n    }\n    memmove(ctx->raw_samples[c] - sconf->max_order,\n            ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,\n            sizeof(*ctx->raw_samples[c]) * sconf->max_order);\n    return 0;\nfail:\n    zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);\n    zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);\n    return ret;\n}', 'static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)\n{\n    int ret;\n    if ((ret = read_block(ctx, bd)) < 0)\n        return ret;\n    return decode_block(ctx, bd);\n}', 'static int read_block(ALSDecContext *ctx, ALSBlockData *bd)\n{\n    int ret = 0;\n    BitstreamContext *bc = &ctx->bc;\n    *bd->shift_lsbs = 0;\n    if (bitstream_read_bit(bc)) {\n        ret = read_var_block_data(ctx, bd);\n    } else {\n        read_const_block_data(ctx, bd);\n    }\n    return ret;\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}', 'static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)\n{\n    ALSSpecificConfig *sconf = &ctx->sconf;\n    AVCodecContext *avctx    = ctx->avctx;\n    BitstreamContext *bc     = &ctx->bc;\n    *bd->raw_samples = 0;\n    *bd->const_block = bitstream_read_bit(bc);\n    bd->js_blocks    = bitstream_read_bit(bc);\n    bitstream_skip(bc, 5);\n    if (*bd->const_block) {\n        unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;\n        *bd->raw_samples = bitstream_read_signed(bc, const_val_bits);\n    }\n    *bd->const_block = 1;\n}', 'static inline void bitstream_skip(BitstreamContext *bc, unsigned n)\n{\n    if (n < bc->bits_left)\n        skip_remaining(bc, n);\n    else {\n        n -= bc->bits_left;\n        bc->bits      = 0;\n        bc->bits_left = 0;\n        if (n >= 64) {\n            unsigned skip = n / 8;\n            n -= skip * 8;\n            bc->ptr += skip;\n        }\n        refill_64(bc);\n        if (n)\n            skip_remaining(bc, n);\n    }\n}', 'static inline void skip_remaining(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    bc->bits >>= n;\n#else\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n}']