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

libavcodec/alsdec.c:1366:9: Call
1364.         bd.prev_raw_samples = ctx->prev_raw_samples;
1365. 
1366.         get_block_sizes(ctx, div_blocks, &bs_info);
              ^
1367. 
1368.         for (b = 0; b < ctx->num_blocks; b++) {

libavcodec/alsdec.c:502:1: Parameter `ctx->sconf.frame_length`
  500.  *  actual number of samples.
  501.  */
  502. static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
       ^
  503.                             uint32_t *bs_info)
  504. {

libavcodec/alsdec.c:535:9: Assignment
  533. 
  534.     for (b = 0; b < ctx->num_blocks; b++)
  535.         div_blocks[b] = ctx->sconf.frame_length >> div_blocks[b];
               ^
  536. 
  537.     if (ctx->cur_frame_length != ctx->sconf.frame_length) {

libavcodec/alsdec.c:1369:13: Assignment
1367. 
1368.         for (b = 0; b < ctx->num_blocks; b++) {
1369.             bd.block_length = div_blocks[b];
                  ^
1370. 
1371.             for (c = 0; c < avctx->channels; c++) {

libavcodec/alsdec.c:1406:28: Call
1404.                 bd.quant_cof   = ctx->quant_cof[c];
1405.                 bd.raw_samples = ctx->raw_samples[c] + offset;
1406.                 if ((ret = decode_block(ctx, &bd)) < 0)
                                 ^
1407.                     return ret;
1408.             }

libavcodec/alsdec.c:983:1: Parameter `bd->block_length`
  981. /** Decode the block data.
  982.  */
  983. static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
       ^
  984. {
  985.     unsigned int smp;

libavcodec/alsdec.c:989:9: Call
  987.     // read block type flag and read the samples accordingly
  988.     if (*bd->const_block)
  989.         decode_const_block_data(ctx, bd);
               ^
  990.     else if (decode_var_block_data(ctx, bd))
  991.         return -1;

libavcodec/alsdec.c:580:1: <LHS trace>
578. /** Decode the block data for a constant block
579.  */
580. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
     ^
581. {
582.     int      smp = bd->block_length - 1;

libavcodec/alsdec.c:580:1: Parameter `bd->block_length`
    578. /** Decode the block data for a constant block
    579.  */
    580. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
         ^
    581. {
    582.     int      smp = bd->block_length - 1;

libavcodec/alsdec.c:582:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `decode_block` 
    580. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
    581. {
    582.     int      smp = bd->block_length - 1;
             ^
    583.     int32_t  val = *bd->raw_samples;
    584.     int32_t *dst = bd->raw_samples + 1;

static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
    int      smp = bd->block_length - 1;
    int32_t  val = *bd->raw_samples;
    int32_t *dst = bd->raw_samples + 1;
    for (; smp; smp--)
        *dst++ = val;
}
['static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)\n{\n    ALSSpecificConfig *sconf = &ctx->sconf;\n    AVCodecContext *avctx    = ctx->avctx;\n    GetBitContext *gb = &ctx->gb;\n    unsigned int div_blocks[32];\n    unsigned int c;\n    unsigned int js_blocks[2];\n    uint32_t bs_info = 0;\n    if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame)\n        skip_bits_long(gb, 32);\n    if (sconf->mc_coding && sconf->joint_stereo) {\n        ctx->js_switch = get_bits1(gb);\n        align_get_bits(gb);\n    }\n    if (!sconf->mc_coding || ctx->js_switch) {\n        int independent_bs = !sconf->joint_stereo;\n        for (c = 0; c < avctx->channels; c++) {\n            js_blocks[0] = 0;\n            js_blocks[1] = 0;\n            get_block_sizes(ctx, div_blocks, &bs_info);\n            if (sconf->joint_stereo && sconf->block_switching)\n                if (bs_info >> 31)\n                    independent_bs = 2;\n            if (c == avctx->channels - 1)\n                independent_bs = 1;\n            if (independent_bs) {\n                if (decode_blocks_ind(ctx, ra_frame, c, div_blocks, js_blocks))\n                    return -1;\n                independent_bs--;\n            } else {\n                if (decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks))\n                    return -1;\n                c++;\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        }\n    } else {\n        ALSBlockData   bd = { 0 };\n        int            b, ret;\n        int            *reverted_channels = ctx->reverted_channels;\n        unsigned int   offset             = 0;\n        for (c = 0; c < avctx->channels; c++)\n            if (ctx->chan_data[c] < ctx->chan_data_buffer) {\n                av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data!\\n");\n                return -1;\n            }\n        memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels);\n        bd.ra_block         = ra_frame;\n        bd.prev_raw_samples = ctx->prev_raw_samples;\n        get_block_sizes(ctx, div_blocks, &bs_info);\n        for (b = 0; b < ctx->num_blocks; b++) {\n            bd.block_length = div_blocks[b];\n            for (c = 0; c < avctx->channels; c++) {\n                bd.const_block = ctx->const_block + c;\n                bd.shift_lsbs  = ctx->shift_lsbs + c;\n                bd.opt_order   = ctx->opt_order + c;\n                bd.store_prev_samples = ctx->store_prev_samples + c;\n                bd.use_ltp     = ctx->use_ltp + c;\n                bd.ltp_lag     = ctx->ltp_lag + c;\n                bd.ltp_gain    = ctx->ltp_gain[c];\n                bd.lpc_cof     = ctx->lpc_cof[c];\n                bd.quant_cof   = ctx->quant_cof[c];\n                bd.raw_samples = ctx->raw_samples[c] + offset;\n                bd.raw_other   = NULL;\n                if ((ret = read_block(ctx, &bd)) < 0)\n                    return ret;\n                if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0)\n                    return ret;\n            }\n            for (c = 0; c < avctx->channels; c++)\n                if (revert_channel_correlation(ctx, &bd, ctx->chan_data,\n                                               reverted_channels, offset, c))\n                    return -1;\n            for (c = 0; c < avctx->channels; c++) {\n                bd.const_block = ctx->const_block + c;\n                bd.shift_lsbs  = ctx->shift_lsbs + c;\n                bd.opt_order   = ctx->opt_order + c;\n                bd.store_prev_samples = ctx->store_prev_samples + c;\n                bd.use_ltp     = ctx->use_ltp + c;\n                bd.ltp_lag     = ctx->ltp_lag + c;\n                bd.ltp_gain    = ctx->ltp_gain[c];\n                bd.lpc_cof     = ctx->lpc_cof[c];\n                bd.quant_cof   = ctx->quant_cof[c];\n                bd.raw_samples = ctx->raw_samples[c] + offset;\n                if ((ret = decode_block(ctx, &bd)) < 0)\n                    return ret;\n            }\n            memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels));\n            offset      += div_blocks[b];\n            bd.ra_block  = 0;\n        }\n        for (c = 0; c < avctx->channels; c++)\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    }\n    return 0;\n}', 'static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,\n                            uint32_t *bs_info)\n{\n    ALSSpecificConfig *sconf     = &ctx->sconf;\n    GetBitContext *gb            = &ctx->gb;\n    unsigned int *ptr_div_blocks = div_blocks;\n    unsigned int b;\n    if (sconf->block_switching) {\n        unsigned int bs_info_len = 1 << (sconf->block_switching + 2);\n        *bs_info = get_bits_long(gb, bs_info_len);\n        *bs_info <<= (32 - bs_info_len);\n    }\n    ctx->num_blocks = 0;\n    parse_bs_info(*bs_info, 0, 0, &ptr_div_blocks, &ctx->num_blocks);\n    for (b = 0; b < ctx->num_blocks; b++)\n        div_blocks[b] = ctx->sconf.frame_length >> div_blocks[b];\n    if (ctx->cur_frame_length != ctx->sconf.frame_length) {\n        unsigned int remaining = ctx->cur_frame_length;\n        for (b = 0; b < ctx->num_blocks; b++) {\n            if (remaining <= div_blocks[b]) {\n                div_blocks[b] = remaining;\n                ctx->num_blocks = b + 1;\n                break;\n            }\n            remaining -= div_blocks[b];\n        }\n    }\n}', 'static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)\n{\n    unsigned int smp;\n    if (*bd->const_block)\n        decode_const_block_data(ctx, bd);\n    else if (decode_var_block_data(ctx, bd))\n        return -1;\n    if (*bd->shift_lsbs)\n        for (smp = 0; smp < bd->block_length; smp++)\n            bd->raw_samples[smp] <<= *bd->shift_lsbs;\n    return 0;\n}', 'static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)\n{\n    int      smp = bd->block_length - 1;\n    int32_t  val = *bd->raw_samples;\n    int32_t *dst = bd->raw_samples + 1;\n    for (; smp; smp--)\n        *dst++ = val;\n}']