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

libavcodec/alsdec.c:1356:9: Call
1354.         bd.prev_raw_samples = ctx->prev_raw_samples;
1355. 
1356.         get_block_sizes(ctx, div_blocks, &bs_info);
              ^
1357. 
1358.         for (b = 0; b < ctx->num_blocks; b++) {

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

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

libavcodec/alsdec.c:1359:13: Assignment
1357. 
1358.         for (b = 0; b < ctx->num_blocks; b++) {
1359.             bd.block_length = div_blocks[b];
                  ^
1360. 
1361.             for (c = 0; c < avctx->channels; c++) {

libavcodec/alsdec.c:1380:21: Call
1378. 
1379.             for (c = 0; c < avctx->channels; c++)
1380.                 if (revert_channel_correlation(ctx, &bd, ctx->chan_data,
                          ^
1381.                                                reverted_channels, offset, c))
1382.                     return -1;

libavcodec/alsdec.c:1197:1: <LHS trace>
1195. /** Recursively reverts the inter-channel correlation for a block.
1196.  */
1197. static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
      ^
1198.                                        ALSChannelData **cd, int *reverted,
1199.                                        unsigned int offset, int c)

libavcodec/alsdec.c:1197:1: Parameter `bd->block_length`
  1195. /** Recursively reverts the inter-channel correlation for a block.
  1196.  */
  1197. static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
        ^
  1198.                                        ALSChannelData **cd, int *reverted,
  1199.                                        unsigned int offset, int c)

libavcodec/alsdec.c:1237:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `revert_channel_correlation` 
  1235.         unsigned int smp;
  1236.         unsigned int begin = 1;
  1237.         unsigned int end   = bd->block_length - 1;
                ^
  1238.         int64_t y;
  1239.         int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;

static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
                                       ALSChannelData **cd, int *reverted,
                                       unsigned int offset, int c)
{
    ALSChannelData *ch = cd[c];
    unsigned int   dep = 0;
    unsigned int channels = ctx->avctx->channels;
    if (reverted[c])
        return 0;
    reverted[c] = 1;
    while (dep < channels && !ch[dep].stop_flag) {
        revert_channel_correlation(ctx, bd, cd, reverted, offset,
                                   ch[dep].master_channel);
        dep++;
    }
    if (dep == channels) {
        av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation!\n");
        return -1;
    }
    bd->const_block = ctx->const_block + c;
    bd->shift_lsbs  = ctx->shift_lsbs + c;
    bd->opt_order   = ctx->opt_order + c;
    bd->store_prev_samples = ctx->store_prev_samples + c;
    bd->use_ltp     = ctx->use_ltp + c;
    bd->ltp_lag     = ctx->ltp_lag + c;
    bd->ltp_gain    = ctx->ltp_gain[c];
    bd->lpc_cof     = ctx->lpc_cof[c];
    bd->quant_cof   = ctx->quant_cof[c];
    bd->raw_samples = ctx->raw_samples[c] + offset;
    dep = 0;
    while (!ch[dep].stop_flag) {
        unsigned int smp;
        unsigned int begin = 1;
        unsigned int end   = bd->block_length - 1;
        int64_t y;
        int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
        if (ch[dep].time_diff_flag) {
            int t = ch[dep].time_diff_index;
            if (ch[dep].time_diff_sign) {
                t      = -t;
                begin -= t;
            } else {
                end   -= t;
            }
            for (smp = begin; smp < end; smp++) {
                y  = (1 << 6) +
                     MUL64(ch[dep].weighting[0], master[smp - 1    ]) +
                     MUL64(ch[dep].weighting[1], master[smp        ]) +
                     MUL64(ch[dep].weighting[2], master[smp + 1    ]) +
                     MUL64(ch[dep].weighting[3], master[smp - 1 + t]) +
                     MUL64(ch[dep].weighting[4], master[smp     + t]) +
                     MUL64(ch[dep].weighting[5], master[smp + 1 + t]);
                bd->raw_samples[smp] += y >> 7;
            }
        } else {
            for (smp = begin; smp < end; smp++) {
                y  = (1 << 6) +
                     MUL64(ch[dep].weighting[0], master[smp - 1]) +
                     MUL64(ch[dep].weighting[1], master[smp    ]) +
                     MUL64(ch[dep].weighting[2], master[smp + 1]);
                bd->raw_samples[smp] += y >> 7;
            }
        }
        dep++;
    }
    return 0;
}
['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;\n        int            b;\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(&bd,               0, sizeof(ALSBlockData));\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                read_block(ctx, &bd);\n                if (read_channel_data(ctx, ctx->chan_data[c], c))\n                    return -1;\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                decode_block(ctx, &bd);\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 revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,\n                                       ALSChannelData **cd, int *reverted,\n                                       unsigned int offset, int c)\n{\n    ALSChannelData *ch = cd[c];\n    unsigned int   dep = 0;\n    unsigned int channels = ctx->avctx->channels;\n    if (reverted[c])\n        return 0;\n    reverted[c] = 1;\n    while (dep < channels && !ch[dep].stop_flag) {\n        revert_channel_correlation(ctx, bd, cd, reverted, offset,\n                                   ch[dep].master_channel);\n        dep++;\n    }\n    if (dep == channels) {\n        av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation!\\n");\n        return -1;\n    }\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    dep = 0;\n    while (!ch[dep].stop_flag) {\n        unsigned int smp;\n        unsigned int begin = 1;\n        unsigned int end   = bd->block_length - 1;\n        int64_t y;\n        int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;\n        if (ch[dep].time_diff_flag) {\n            int t = ch[dep].time_diff_index;\n            if (ch[dep].time_diff_sign) {\n                t      = -t;\n                begin -= t;\n            } else {\n                end   -= t;\n            }\n            for (smp = begin; smp < end; smp++) {\n                y  = (1 << 6) +\n                     MUL64(ch[dep].weighting[0], master[smp - 1    ]) +\n                     MUL64(ch[dep].weighting[1], master[smp        ]) +\n                     MUL64(ch[dep].weighting[2], master[smp + 1    ]) +\n                     MUL64(ch[dep].weighting[3], master[smp - 1 + t]) +\n                     MUL64(ch[dep].weighting[4], master[smp     + t]) +\n                     MUL64(ch[dep].weighting[5], master[smp + 1 + t]);\n                bd->raw_samples[smp] += y >> 7;\n            }\n        } else {\n            for (smp = begin; smp < end; smp++) {\n                y  = (1 << 6) +\n                     MUL64(ch[dep].weighting[0], master[smp - 1]) +\n                     MUL64(ch[dep].weighting[1], master[smp    ]) +\n                     MUL64(ch[dep].weighting[2], master[smp + 1]);\n                bd->raw_samples[smp] += y >> 7;\n            }\n        }\n        dep++;\n    }\n    return 0;\n}']