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

libavcodec/mpegaudiodec.c:814:33: Call
812.                                 l2_unscale_group(steps,  v2       & 15, scale);
813.                             s->sb_samples[ch][k * 12 + l + 1][i] =
814.                                 l2_unscale_group(steps, (v2 >> 4) & 15, scale);
                                     ^
815.                             s->sb_samples[ch][k * 12 + l + 2][i] =
816.                                 l2_unscale_group(steps,  v2 >> 8      , scale);

libavcodec/mpegaudiodec.c:237:1: <Offset trace>
235. }
236. 
237. static inline int l2_unscale_group(int steps, int mant, int scale_factor)
     ^
238. {
239.     int shift, mod, val;

libavcodec/mpegaudiodec.c:237:1: Global `scale_factor_modshift`
  235. }
  236. 
  237. static inline int l2_unscale_group(int steps, int mant, int scale_factor)
       ^
  238. {
  239.     int shift, mod, val;

libavcodec/mpegaudiodec.c:241:5: Assignment
  239.     int shift, mod, val;
  240. 
  241.     shift   = scale_factor_modshift[scale_factor];
           ^
  242.     mod     = shift & 3;
  243.     shift >>= 2;

libavcodec/mpegaudiodec.c:242:5: Assignment
  240. 
  241.     shift   = scale_factor_modshift[scale_factor];
  242.     mod     = shift & 3;
           ^
  243.     shift >>= 2;
  244. 

libavcodec/mpegaudiodec.c:151:1: <Length trace>
149. { FIXR_OLD(1.0 * (v)), FIXR_OLD(0.7937005259 * (v)), FIXR_OLD(0.6299605249 * (v)) }
150. 
151. static const int32_t scale_factor_mult2[3][3] = {
     ^
152.     SCALE_GEN(4.0 / 3.0), /* 3 steps */
153.     SCALE_GEN(4.0 / 5.0), /* 5 steps */

libavcodec/mpegaudiodec.c:151:1: Array declaration
  149. { FIXR_OLD(1.0 * (v)), FIXR_OLD(0.7937005259 * (v)), FIXR_OLD(0.6299605249 * (v)) }
  150. 
  151. static const int32_t scale_factor_mult2[3][3] = {
       ^
  152.     SCALE_GEN(4.0 / 3.0), /* 3 steps */
  153.     SCALE_GEN(4.0 / 5.0), /* 5 steps */

libavcodec/mpegaudiodec.c:245:35: Array access: Offset: [0, 3] Size: 3 by call to `l2_unscale_group` 
  243.     shift >>= 2;
  244. 
  245.     val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];
                                         ^
  246.     /* NOTE: at this point, 0 <= shift <= 21 */
  247.     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    av_dlog(s->avctx, "bound=%d sblimit=%d\\n", bound, sblimit);\n    if (bound > sblimit)\n        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        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                            int v2;\n                            v = get_bits(&s->gb, -bits);\n                            v2 = division_tabs[qindex][v];\n                            steps  = ff_mpa_quant_steps[qindex];\n                            s->sb_samples[ch][k * 12 + l + 0][i] =\n                                l2_unscale_group(steps,  v2       & 15, scale);\n                            s->sb_samples[ch][k * 12 + l + 1][i] =\n                                l2_unscale_group(steps, (v2 >> 4) & 15, scale);\n                            s->sb_samples[ch][k * 12 + l + 2][i] =\n                                l2_unscale_group(steps,  v2 >> 8      , 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}']