libavcodec/mpegaudiodec.c:1234: error: Buffer Overrun L2
  Offset: [0, 3] Size: 3 by call to `l2_unscale_group`.

libavcodec/mpegaudiodec.c:1234:33: Call
1232.                             steps = ff_mpa_quant_steps[qindex];
1233.                             s->sb_samples[ch][k * 12 + l + 0][i] =
1234.                                 l2_unscale_group(steps, v % steps, scale);
                                      ^
1235.                             v = v / steps;
1236.                             s->sb_samples[ch][k * 12 + l + 1][i] =

libavcodec/mpegaudiodec.c:193:1: <Offset trace>
191. }
192. 
193. static inline int l2_unscale_group(int steps, int mant, int scale_factor)
     ^
194. {
195.     int shift, mod, val;

libavcodec/mpegaudiodec.c:193:1: Global `scale_factor_modshift`
  191. }
  192. 
  193. static inline int l2_unscale_group(int steps, int mant, int scale_factor)
       ^
  194. {
  195.     int shift, mod, val;

libavcodec/mpegaudiodec.c:197:5: Assignment
  195.     int shift, mod, val;
  196. 
  197.     shift = scale_factor_modshift[scale_factor];
           ^
  198.     mod = shift & 3;
  199.     shift >>= 2;

libavcodec/mpegaudiodec.c:198:5: Assignment
  196. 
  197.     shift = scale_factor_modshift[scale_factor];
  198.     mod = shift & 3;
           ^
  199.     shift >>= 2;
  200. 

libavcodec/mpegaudiodec.c:107:1: <Length trace>
105. { FIXR_OLD(1.0 * (v)), FIXR_OLD(0.7937005259 * (v)), FIXR_OLD(0.6299605249 * (v)) }
106. 
107. static const int32_t scale_factor_mult2[3][3] = {
     ^
108.     SCALE_GEN(4.0 / 3.0), /* 3 steps */
109.     SCALE_GEN(4.0 / 5.0), /* 5 steps */

libavcodec/mpegaudiodec.c:107:1: Array declaration
  105. { FIXR_OLD(1.0 * (v)), FIXR_OLD(0.7937005259 * (v)), FIXR_OLD(0.6299605249 * (v)) }
  106. 
  107. static const int32_t scale_factor_mult2[3][3] = {
       ^
  108.     SCALE_GEN(4.0 / 3.0), /* 3 steps */
  109.     SCALE_GEN(4.0 / 5.0), /* 5 steps */

libavcodec/mpegaudiodec.c:201:35: Array access: Offset: [0, 3] Size: 3 by call to `l2_unscale_group` 
  199.     shift >>= 2;
  200. 
  201.     val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];
                                         ^
  202.     /* NOTE: at this point, 0 <= shift <= 21 */
  203.     if (shift > 0)

static inline int l2_unscale_group(int steps, int mant, int scale_factor)
{
    int shift, mod, val;
    shift = scale_factor_modshift[scale_factor];
    mod = shift & 3;
    shift >>= 2;
    val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];
    if (shift > 0)
        val = (val + (1 << (shift - 1))) >> shift;
    return val;
}
['static int mp_decode_layer2(MPADecodeContext *s)\n{\n    int sblimit;\n    const unsigned char *alloc_table;\n    int table, bit_alloc_bits, i, j, ch, bound, v;\n    unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];\n    unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];\n    unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3], *sf;\n    int scale, qindex, bits, steps, k, l, m, b;\n    table = ff_mpa_l2_select_table(s->bit_rate / 1000, s->nb_channels,\n                            s->sample_rate, s->lsf);\n    sblimit = ff_mpa_sblimit_table[table];\n    alloc_table = ff_mpa_alloc_tables[table];\n    if (s->mode == MPA_JSTEREO)\n        bound = (s->mode_ext + 1) * 4;\n    else\n        bound = sblimit;\n    dprintf(s->avctx, "bound=%d sblimit=%d\\n", bound, sblimit);\n    if( bound > sblimit ) bound = sblimit;\n    j = 0;\n    for(i=0;i<bound;i++) {\n        bit_alloc_bits = alloc_table[j];\n        for(ch=0;ch<s->nb_channels;ch++) {\n            bit_alloc[ch][i] = get_bits(&s->gb, bit_alloc_bits);\n        }\n        j += 1 << bit_alloc_bits;\n    }\n    for(i=bound;i<sblimit;i++) {\n        bit_alloc_bits = alloc_table[j];\n        v = get_bits(&s->gb, bit_alloc_bits);\n        bit_alloc[0][i] = v;\n        bit_alloc[1][i] = v;\n        j += 1 << bit_alloc_bits;\n    }\n    for(i=0;i<sblimit;i++) {\n        for(ch=0;ch<s->nb_channels;ch++) {\n            if (bit_alloc[ch][i])\n                scale_code[ch][i] = get_bits(&s->gb, 2);\n        }\n    }\n    for(i=0;i<sblimit;i++) {\n        for(ch=0;ch<s->nb_channels;ch++) {\n            if (bit_alloc[ch][i]) {\n                sf = scale_factors[ch][i];\n                switch(scale_code[ch][i]) {\n                default:\n                case 0:\n                    sf[0] = get_bits(&s->gb, 6);\n                    sf[1] = get_bits(&s->gb, 6);\n                    sf[2] = get_bits(&s->gb, 6);\n                    break;\n                case 2:\n                    sf[0] = get_bits(&s->gb, 6);\n                    sf[1] = sf[0];\n                    sf[2] = sf[0];\n                    break;\n                case 1:\n                    sf[0] = get_bits(&s->gb, 6);\n                    sf[2] = get_bits(&s->gb, 6);\n                    sf[1] = sf[0];\n                    break;\n                case 3:\n                    sf[0] = get_bits(&s->gb, 6);\n                    sf[2] = get_bits(&s->gb, 6);\n                    sf[1] = sf[2];\n                    break;\n                }\n            }\n        }\n    }\n    for(k=0;k<3;k++) {\n        for(l=0;l<12;l+=3) {\n            j = 0;\n            for(i=0;i<bound;i++) {\n                bit_alloc_bits = alloc_table[j];\n                for(ch=0;ch<s->nb_channels;ch++) {\n                    b = bit_alloc[ch][i];\n                    if (b) {\n                        scale = scale_factors[ch][i][k];\n                        qindex = alloc_table[j+b];\n                        bits = ff_mpa_quant_bits[qindex];\n                        if (bits < 0) {\n                            v = get_bits(&s->gb, -bits);\n                            steps = ff_mpa_quant_steps[qindex];\n                            s->sb_samples[ch][k * 12 + l + 0][i] =\n                                l2_unscale_group(steps, v % steps, scale);\n                            v = v / steps;\n                            s->sb_samples[ch][k * 12 + l + 1][i] =\n                                l2_unscale_group(steps, v % steps, scale);\n                            v = v / steps;\n                            s->sb_samples[ch][k * 12 + l + 2][i] =\n                                l2_unscale_group(steps, v, scale);\n                        } else {\n                            for(m=0;m<3;m++) {\n                                v = get_bits(&s->gb, bits);\n                                v = l1_unscale(bits - 1, v, scale);\n                                s->sb_samples[ch][k * 12 + l + m][i] = v;\n                            }\n                        }\n                    } else {\n                        s->sb_samples[ch][k * 12 + l + 0][i] = 0;\n                        s->sb_samples[ch][k * 12 + l + 1][i] = 0;\n                        s->sb_samples[ch][k * 12 + l + 2][i] = 0;\n                    }\n                }\n                j += 1 << bit_alloc_bits;\n            }\n            for(i=bound;i<sblimit;i++) {\n                bit_alloc_bits = alloc_table[j];\n                b = bit_alloc[0][i];\n                if (b) {\n                    int mant, scale0, scale1;\n                    scale0 = scale_factors[0][i][k];\n                    scale1 = scale_factors[1][i][k];\n                    qindex = alloc_table[j+b];\n                    bits = ff_mpa_quant_bits[qindex];\n                    if (bits < 0) {\n                        v = get_bits(&s->gb, -bits);\n                        steps = ff_mpa_quant_steps[qindex];\n                        mant = v % steps;\n                        v = v / steps;\n                        s->sb_samples[0][k * 12 + l + 0][i] =\n                            l2_unscale_group(steps, mant, scale0);\n                        s->sb_samples[1][k * 12 + l + 0][i] =\n                            l2_unscale_group(steps, mant, scale1);\n                        mant = v % steps;\n                        v = v / steps;\n                        s->sb_samples[0][k * 12 + l + 1][i] =\n                            l2_unscale_group(steps, mant, scale0);\n                        s->sb_samples[1][k * 12 + l + 1][i] =\n                            l2_unscale_group(steps, mant, scale1);\n                        s->sb_samples[0][k * 12 + l + 2][i] =\n                            l2_unscale_group(steps, v, scale0);\n                        s->sb_samples[1][k * 12 + l + 2][i] =\n                            l2_unscale_group(steps, v, scale1);\n                    } else {\n                        for(m=0;m<3;m++) {\n                            mant = get_bits(&s->gb, bits);\n                            s->sb_samples[0][k * 12 + l + m][i] =\n                                l1_unscale(bits - 1, mant, scale0);\n                            s->sb_samples[1][k * 12 + l + m][i] =\n                                l1_unscale(bits - 1, mant, scale1);\n                        }\n                    }\n                } else {\n                    s->sb_samples[0][k * 12 + l + 0][i] = 0;\n                    s->sb_samples[0][k * 12 + l + 1][i] = 0;\n                    s->sb_samples[0][k * 12 + l + 2][i] = 0;\n                    s->sb_samples[1][k * 12 + l + 0][i] = 0;\n                    s->sb_samples[1][k * 12 + l + 1][i] = 0;\n                    s->sb_samples[1][k * 12 + l + 2][i] = 0;\n                }\n                j += 1 << bit_alloc_bits;\n            }\n            for(i=sblimit;i<SBLIMIT;i++) {\n                for(ch=0;ch<s->nb_channels;ch++) {\n                    s->sb_samples[ch][k * 12 + l + 0][i] = 0;\n                    s->sb_samples[ch][k * 12 + l + 1][i] = 0;\n                    s->sb_samples[ch][k * 12 + l + 2][i] = 0;\n                }\n            }\n        }\n    }\n    return 3 * 12;\n}', 'static inline int l2_unscale_group(int steps, int mant, int scale_factor)\n{\n    int shift, mod, val;\n    shift = scale_factor_modshift[scale_factor];\n    mod = shift & 3;\n    shift >>= 2;\n    val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];\n    if (shift > 0)\n        val = (val + (1 << (shift - 1))) >> shift;\n    return val;\n}']