libavcodec/wmaprodec.c:941: error: Integer Overflow L2
  ([0, 1] - 1):unsigned32.

libavcodec/wmaprodec.c:941:32: <LHS trace>
939.                         skip = scale_rl_run[idx];
940.                         val  = scale_rl_level[idx];
941.                         sign = get_bits1(&s->gb)-1;
                                    ^
942.                     }
943. 

libavcodec/wmaprodec.c:941:32: Call
939.                         skip = scale_rl_run[idx];
940.                         val  = scale_rl_level[idx];
941.                         sign = get_bits1(&s->gb)-1;
                                    ^
942.                     }
943. 

libavcodec/get_bits.h:271:1: Parameter `s->index`
  269. }
  270. 
  271. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  272. {
  273.     unsigned int index = s->index;

libavcodec/get_bits.h:273:5: Assignment
  271. static inline unsigned int get_bits1(GetBitContext *s)
  272. {
  273.     unsigned int index = s->index;
           ^
  274.     uint8_t result     = s->buffer[index >> 3];
  275. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:276:5: Assignment
  274.     uint8_t result     = s->buffer[index >> 3];
  275. #ifdef BITSTREAM_READER_LE
  276.     result >>= index & 7;
           ^
  277.     result  &= 1;
  278. #else

libavcodec/get_bits.h:277:5: Assignment
  275. #ifdef BITSTREAM_READER_LE
  276.     result >>= index & 7;
  277.     result  &= 1;
           ^
  278. #else
  279.     result <<= index & 7;

libavcodec/get_bits.h:288:5: Assignment
  286.     s->index = index;
  287. 
  288.     return result;
           ^
  289. }
  290. 

libavcodec/wmaprodec.c:941:25: Binary operation: ([0, 1] - 1):unsigned32
939.                         skip = scale_rl_run[idx];
940.                         val  = scale_rl_level[idx];
941.                         sign = get_bits1(&s->gb)-1;
                             ^
942.                     }
943. 

static int decode_scale_factors(WMAProDecodeCtx* s)
{
    int i;
    for (i = 0; i < s->channels_for_cur_subframe; i++) {
        int c = s->channel_indexes_for_cur_subframe[i];
        int* sf;
        int* sf_end;
        s->channel[c].scale_factors = s->channel[c].saved_scale_factors[!s->channel[c].scale_factor_idx];
        sf_end = s->channel[c].scale_factors + s->num_bands;
        if (s->channel[c].reuse_sf) {
            const int8_t* sf_offsets = s->sf_offsets[s->table_idx][s->channel[c].table_idx];
            int b;
            for (b = 0; b < s->num_bands; b++)
                s->channel[c].scale_factors[b] =
                    s->channel[c].saved_scale_factors[s->channel[c].scale_factor_idx][*sf_offsets++];
        }
        if (!s->channel[c].cur_subframe || get_bits1(&s->gb)) {
            if (!s->channel[c].reuse_sf) {
                int val;
                s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1;
                val = 45 / s->channel[c].scale_factor_step;
                for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) {
                    val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH) - 60;
                    *sf = val;
                }
            } else {
                int i;
                for (i = 0; i < s->num_bands; i++) {
                    int idx;
                    int skip;
                    int val;
                    int sign;
                    idx = get_vlc2(&s->gb, sf_rl_vlc.table, VLCBITS, SCALERLMAXDEPTH);
                    if (!idx) {
                        uint32_t code = get_bits(&s->gb, 14);
                        val  =  code >> 6;
                        sign = (code & 1) - 1;
                        skip = (code & 0x3f) >> 1;
                    } else if (idx == 1) {
                        break;
                    } else {
                        skip = scale_rl_run[idx];
                        val  = scale_rl_level[idx];
                        sign = get_bits1(&s->gb)-1;
                    }
                    i += skip;
                    if (i >= s->num_bands) {
                        av_log(s->avctx, AV_LOG_ERROR,
                               "invalid scale factor coding\n");
                        return AVERROR_INVALIDDATA;
                    }
                    s->channel[c].scale_factors[i] += (val ^ sign) - sign;
                }
            }
            s->channel[c].scale_factor_idx = !s->channel[c].scale_factor_idx;
            s->channel[c].table_idx = s->table_idx;
            s->channel[c].reuse_sf  = 1;
        }
        s->channel[c].max_scale_factor = s->channel[c].scale_factors[0];
        for (sf = s->channel[c].scale_factors + 1; sf < sf_end; sf++) {
            s->channel[c].max_scale_factor =
                FFMAX(s->channel[c].max_scale_factor, *sf);
        }
    }
    return 0;
}
['static int decode_scale_factors(WMAProDecodeCtx* s)\n{\n    int i;\n    for (i = 0; i < s->channels_for_cur_subframe; i++) {\n        int c = s->channel_indexes_for_cur_subframe[i];\n        int* sf;\n        int* sf_end;\n        s->channel[c].scale_factors = s->channel[c].saved_scale_factors[!s->channel[c].scale_factor_idx];\n        sf_end = s->channel[c].scale_factors + s->num_bands;\n        if (s->channel[c].reuse_sf) {\n            const int8_t* sf_offsets = s->sf_offsets[s->table_idx][s->channel[c].table_idx];\n            int b;\n            for (b = 0; b < s->num_bands; b++)\n                s->channel[c].scale_factors[b] =\n                    s->channel[c].saved_scale_factors[s->channel[c].scale_factor_idx][*sf_offsets++];\n        }\n        if (!s->channel[c].cur_subframe || get_bits1(&s->gb)) {\n            if (!s->channel[c].reuse_sf) {\n                int val;\n                s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1;\n                val = 45 / s->channel[c].scale_factor_step;\n                for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) {\n                    val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH) - 60;\n                    *sf = val;\n                }\n            } else {\n                int i;\n                for (i = 0; i < s->num_bands; i++) {\n                    int idx;\n                    int skip;\n                    int val;\n                    int sign;\n                    idx = get_vlc2(&s->gb, sf_rl_vlc.table, VLCBITS, SCALERLMAXDEPTH);\n                    if (!idx) {\n                        uint32_t code = get_bits(&s->gb, 14);\n                        val  =  code >> 6;\n                        sign = (code & 1) - 1;\n                        skip = (code & 0x3f) >> 1;\n                    } else if (idx == 1) {\n                        break;\n                    } else {\n                        skip = scale_rl_run[idx];\n                        val  = scale_rl_level[idx];\n                        sign = get_bits1(&s->gb)-1;\n                    }\n                    i += skip;\n                    if (i >= s->num_bands) {\n                        av_log(s->avctx, AV_LOG_ERROR,\n                               "invalid scale factor coding\\n");\n                        return AVERROR_INVALIDDATA;\n                    }\n                    s->channel[c].scale_factors[i] += (val ^ sign) - sign;\n                }\n            }\n            s->channel[c].scale_factor_idx = !s->channel[c].scale_factor_idx;\n            s->channel[c].table_idx = s->table_idx;\n            s->channel[c].reuse_sf  = 1;\n        }\n        s->channel[c].max_scale_factor = s->channel[c].scale_factors[0];\n        for (sf = s->channel[c].scale_factors + 1; sf < sf_end; sf++) {\n            s->channel[c].max_scale_factor =\n                FFMAX(s->channel[c].max_scale_factor, *sf);\n        }\n    }\n    return 0;\n}', 'static inline unsigned int get_bits1(GetBitContext *s)\n{\n    unsigned int index = s->index;\n    uint8_t result     = s->buffer[index >> 3];\n#ifdef BITSTREAM_READER_LE\n    result >>= index & 7;\n    result  &= 1;\n#else\n    result <<= index & 7;\n    result >>= 8 - 1;\n#endif\n#if !UNCHECKED_BITSTREAM_READER\n    if (s->index < s->size_in_bits_plus8)\n#endif\n        index++;\n    s->index = index;\n    return result;\n}']