libavcodec/mpegaudiodec.c:1947: error: Buffer Overrun L2
  Offset: [0, 97] (⇐ [0, 1] + [0, 96]) Size: 32 by call to `compute_imdct`.

libavcodec/mpegaudiodec.c:1711:1: Parameter `s->sb_samples[*][*][*]`
1709. 
1710. /* main layer3 decoding function */
1711. static int mp_decode_layer3(MPADecodeContext *s)
      ^
1712. {
1713.     int nb_granules, main_data_begin, private_bits;

libavcodec/mpegaudiodec.c:1947:13: Call
1945.             reorder_block(s, g);
1946.             compute_antialias(s, g);
1947.             compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
                  ^
1948.         }
1949.     } /* gr */

libavcodec/mpegaudiodec.c:1619:1: Parameter `*sb_samples`
  1617. #endif
  1618. 
  1619. static void compute_imdct(MPADecodeContext *s,
        ^
  1620.                           GranuleDef *g,
  1621.                           INTFLOAT *sb_samples,

libavcodec/mpegaudiodec.c:1654:9: Assignment
  1652.     for(j=0;j<mdct_long_end;j++) {
  1653.         /* apply window & overlap with previous buffer */
  1654.         out_ptr = sb_samples + j;
                ^
  1655.         /* select window */
  1656.         if (g->switch_point && j < 2)

libavcodec/mpegaudiodec.c:1662:9: Call
  1660.         /* select frequency inversion */
  1661.         win = win1 + ((4 * 36) & -(j & 1));
  1662.         imdct36(out_ptr, buf, ptr, win);
                ^
  1663.         out_ptr += 18*SBLIMIT;
  1664.         ptr += 18;

libavcodec/mpegaudiodec.c:864:9: <Offset trace>
862. 
863.     i = 0;
864.     for(j=0;j<4;j++) {
             ^
865.         t0 = tmp[i];
866.         t1 = tmp[i + 2];

libavcodec/mpegaudiodec.c:864:9: Assignment
    862. 
    863.     i = 0;
    864.     for(j=0;j<4;j++) {
                 ^
    865.         t0 = tmp[i];
    866.         t1 = tmp[i + 2];

libavcodec/mpegaudiodec.c:821:1: <Length trace>
819. 
820. /* using Lee like decomposition followed by hand coded 9 points DCT */
821. static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win)
     ^
822. {
823.     int i, j;

libavcodec/mpegaudiodec.c:821:1: Parameter `*out`
    819. 
    820. /* using Lee like decomposition followed by hand coded 9 points DCT */
    821. static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win)
         ^
    822. {
    823.     int i, j;

libavcodec/mpegaudiodec.c:885:9: Array access: Offset: [0, 97] (⇐ [0, 1] + [0, 96]) Size: 32 by call to `compute_imdct` 
    883.         t1 = s2 - s3;
    884.         out[(9 + 8 - j)*SBLIMIT] =  MULH3(t1, win[9 + 8 - j], 1) + buf[9 + 8 - j];
    885.         out[(        j)*SBLIMIT] =  MULH3(t1, win[        j], 1) + buf[        j];
                 ^
    886.         buf[9 + 8 - j] = MULH3(t0, win[18 + 9 + 8 - j], 1);
    887.         buf[      + j] = MULH3(t0, win[18         + j], 1);

static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win)
{
    int i, j;
    INTFLOAT t0, t1, t2, t3, s0, s1, s2, s3;
    INTFLOAT tmp[18], *tmp1, *in1;
    for(i=17;i>=1;i--)
        in[i] += in[i-1];
    for(i=17;i>=3;i-=2)
        in[i] += in[i-2];
    for(j=0;j<2;j++) {
        tmp1 = tmp + j;
        in1 = in + j;
        t2 = in1[2*4] + in1[2*8] - in1[2*2];
        t3 = in1[2*0] + SHR(in1[2*6],1);
        t1 = in1[2*0] - in1[2*6];
        tmp1[ 6] = t1 - SHR(t2,1);
        tmp1[16] = t1 + t2;
        t0 = MULH3(in1[2*2] + in1[2*4] ,    C2, 2);
        t1 = MULH3(in1[2*4] - in1[2*8] , -2*C8, 1);
        t2 = MULH3(in1[2*2] + in1[2*8] ,   -C4, 2);
        tmp1[10] = t3 - t0 - t2;
        tmp1[ 2] = t3 + t0 + t1;
        tmp1[14] = t3 + t2 - t1;
        tmp1[ 4] = MULH3(in1[2*5] + in1[2*7] - in1[2*1], -C3, 2);
        t2 = MULH3(in1[2*1] + in1[2*5],    C1, 2);
        t3 = MULH3(in1[2*5] - in1[2*7], -2*C7, 1);
        t0 = MULH3(in1[2*3], C3, 2);
        t1 = MULH3(in1[2*1] + in1[2*7],   -C5, 2);
        tmp1[ 0] = t2 + t3 + t0;
        tmp1[12] = t2 + t1 - t0;
        tmp1[ 8] = t3 - t1 - t0;
    }
    i = 0;
    for(j=0;j<4;j++) {
        t0 = tmp[i];
        t1 = tmp[i + 2];
        s0 = t1 + t0;
        s2 = t1 - t0;
        t2 = tmp[i + 1];
        t3 = tmp[i + 3];
        s1 = MULH3(t3 + t2, icos36h[j], 2);
        s3 = MULLx(t3 - t2, icos36[8 - j], FRAC_BITS);
        t0 = s0 + s1;
        t1 = s0 - s1;
        out[(9 + j)*SBLIMIT] =  MULH3(t1, win[9 + j], 1) + buf[9 + j];
        out[(8 - j)*SBLIMIT] =  MULH3(t1, win[8 - j], 1) + buf[8 - j];
        buf[9 + j] = MULH3(t0, win[18 + 9 + j], 1);
        buf[8 - j] = MULH3(t0, win[18 + 8 - j], 1);
        t0 = s2 + s3;
        t1 = s2 - s3;
        out[(9 + 8 - j)*SBLIMIT] =  MULH3(t1, win[9 + 8 - j], 1) + buf[9 + 8 - j];
        out[(        j)*SBLIMIT] =  MULH3(t1, win[        j], 1) + buf[        j];
        buf[9 + 8 - j] = MULH3(t0, win[18 + 9 + 8 - j], 1);
        buf[      + j] = MULH3(t0, win[18         + j], 1);
        i += 4;
    }
    s0 = tmp[16];
    s1 = MULH3(tmp[17], icos36h[4], 2);
    t0 = s0 + s1;
    t1 = s0 - s1;
    out[(9 + 4)*SBLIMIT] =  MULH3(t1, win[9 + 4], 1) + buf[9 + 4];
    out[(8 - 4)*SBLIMIT] =  MULH3(t1, win[8 - 4], 1) + buf[8 - 4];
    buf[9 + 4] = MULH3(t0, win[18 + 9 + 4], 1);
    buf[8 - 4] = MULH3(t0, win[18 + 8 - 4], 1);
}
['static int mp_decode_layer3(MPADecodeContext *s)\n{\n    int nb_granules, main_data_begin, private_bits;\n    int gr, ch, blocksplit_flag, i, j, k, n, bits_pos;\n    GranuleDef *g;\n    int16_t exponents[576];\n    if (s->lsf) {\n        main_data_begin = get_bits(&s->gb, 8);\n        private_bits = get_bits(&s->gb, s->nb_channels);\n        nb_granules = 1;\n    } else {\n        main_data_begin = get_bits(&s->gb, 9);\n        if (s->nb_channels == 2)\n            private_bits = get_bits(&s->gb, 3);\n        else\n            private_bits = get_bits(&s->gb, 5);\n        nb_granules = 2;\n        for(ch=0;ch<s->nb_channels;ch++) {\n            s->granules[ch][0].scfsi = 0;\n            s->granules[ch][1].scfsi = get_bits(&s->gb, 4);\n        }\n    }\n    for(gr=0;gr<nb_granules;gr++) {\n        for(ch=0;ch<s->nb_channels;ch++) {\n            dprintf(s->avctx, "gr=%d ch=%d: side_info\\n", gr, ch);\n            g = &s->granules[ch][gr];\n            g->part2_3_length = get_bits(&s->gb, 12);\n            g->big_values = get_bits(&s->gb, 9);\n            if(g->big_values > 288){\n                av_log(s->avctx, AV_LOG_ERROR, "big_values too big\\n");\n                return -1;\n            }\n            g->global_gain = get_bits(&s->gb, 8);\n            if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) ==\n                MODE_EXT_MS_STEREO)\n                g->global_gain -= 2;\n            if (s->lsf)\n                g->scalefac_compress = get_bits(&s->gb, 9);\n            else\n                g->scalefac_compress = get_bits(&s->gb, 4);\n            blocksplit_flag = get_bits1(&s->gb);\n            if (blocksplit_flag) {\n                g->block_type = get_bits(&s->gb, 2);\n                if (g->block_type == 0){\n                    av_log(s->avctx, AV_LOG_ERROR, "invalid block type\\n");\n                    return -1;\n                }\n                g->switch_point = get_bits1(&s->gb);\n                for(i=0;i<2;i++)\n                    g->table_select[i] = get_bits(&s->gb, 5);\n                for(i=0;i<3;i++)\n                    g->subblock_gain[i] = get_bits(&s->gb, 3);\n                ff_init_short_region(s, g);\n            } else {\n                int region_address1, region_address2;\n                g->block_type = 0;\n                g->switch_point = 0;\n                for(i=0;i<3;i++)\n                    g->table_select[i] = get_bits(&s->gb, 5);\n                region_address1 = get_bits(&s->gb, 4);\n                region_address2 = get_bits(&s->gb, 3);\n                dprintf(s->avctx, "region1=%d region2=%d\\n",\n                        region_address1, region_address2);\n                ff_init_long_region(s, g, region_address1, region_address2);\n            }\n            ff_region_offset2size(g);\n            ff_compute_band_indexes(s, g);\n            g->preflag = 0;\n            if (!s->lsf)\n                g->preflag = get_bits1(&s->gb);\n            g->scalefac_scale = get_bits1(&s->gb);\n            g->count1table_select = get_bits1(&s->gb);\n            dprintf(s->avctx, "block_type=%d switch_point=%d\\n",\n                    g->block_type, g->switch_point);\n        }\n    }\n  if (!s->adu_mode) {\n    const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);\n    assert((get_bits_count(&s->gb) & 7) == 0);\n    dprintf(s->avctx, "seekback: %d\\n", main_data_begin);\n    memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);\n    s->in_gb= s->gb;\n        init_get_bits(&s->gb, s->last_buf, s->last_buf_size*8);\n        skip_bits_long(&s->gb, 8*(s->last_buf_size - main_data_begin));\n  }\n    for(gr=0;gr<nb_granules;gr++) {\n        for(ch=0;ch<s->nb_channels;ch++) {\n            g = &s->granules[ch][gr];\n            if(get_bits_count(&s->gb)<0){\n                av_log(s->avctx, AV_LOG_DEBUG, "mdb:%d, lastbuf:%d skipping granule %d\\n",\n                                            main_data_begin, s->last_buf_size, gr);\n                skip_bits_long(&s->gb, g->part2_3_length);\n                memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid));\n                if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer){\n                    skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits);\n                    s->gb= s->in_gb;\n                    s->in_gb.buffer=NULL;\n                }\n                continue;\n            }\n            bits_pos = get_bits_count(&s->gb);\n            if (!s->lsf) {\n                uint8_t *sc;\n                int slen, slen1, slen2;\n                slen1 = slen_table[0][g->scalefac_compress];\n                slen2 = slen_table[1][g->scalefac_compress];\n                dprintf(s->avctx, "slen1=%d slen2=%d\\n", slen1, slen2);\n                if (g->block_type == 2) {\n                    n = g->switch_point ? 17 : 18;\n                    j = 0;\n                    if(slen1){\n                        for(i=0;i<n;i++)\n                            g->scale_factors[j++] = get_bits(&s->gb, slen1);\n                    }else{\n                        for(i=0;i<n;i++)\n                            g->scale_factors[j++] = 0;\n                    }\n                    if(slen2){\n                        for(i=0;i<18;i++)\n                            g->scale_factors[j++] = get_bits(&s->gb, slen2);\n                        for(i=0;i<3;i++)\n                            g->scale_factors[j++] = 0;\n                    }else{\n                        for(i=0;i<21;i++)\n                            g->scale_factors[j++] = 0;\n                    }\n                } else {\n                    sc = s->granules[ch][0].scale_factors;\n                    j = 0;\n                    for(k=0;k<4;k++) {\n                        n = (k == 0 ? 6 : 5);\n                        if ((g->scfsi & (0x8 >> k)) == 0) {\n                            slen = (k < 2) ? slen1 : slen2;\n                            if(slen){\n                                for(i=0;i<n;i++)\n                                    g->scale_factors[j++] = get_bits(&s->gb, slen);\n                            }else{\n                                for(i=0;i<n;i++)\n                                    g->scale_factors[j++] = 0;\n                            }\n                        } else {\n                            for(i=0;i<n;i++) {\n                                g->scale_factors[j] = sc[j];\n                                j++;\n                            }\n                        }\n                    }\n                    g->scale_factors[j++] = 0;\n                }\n            } else {\n                int tindex, tindex2, slen[4], sl, sf;\n                if (g->block_type == 2) {\n                    tindex = g->switch_point ? 2 : 1;\n                } else {\n                    tindex = 0;\n                }\n                sf = g->scalefac_compress;\n                if ((s->mode_ext & MODE_EXT_I_STEREO) && ch == 1) {\n                    sf >>= 1;\n                    if (sf < 180) {\n                        lsf_sf_expand(slen, sf, 6, 6, 0);\n                        tindex2 = 3;\n                    } else if (sf < 244) {\n                        lsf_sf_expand(slen, sf - 180, 4, 4, 0);\n                        tindex2 = 4;\n                    } else {\n                        lsf_sf_expand(slen, sf - 244, 3, 0, 0);\n                        tindex2 = 5;\n                    }\n                } else {\n                    if (sf < 400) {\n                        lsf_sf_expand(slen, sf, 5, 4, 4);\n                        tindex2 = 0;\n                    } else if (sf < 500) {\n                        lsf_sf_expand(slen, sf - 400, 5, 4, 0);\n                        tindex2 = 1;\n                    } else {\n                        lsf_sf_expand(slen, sf - 500, 3, 0, 0);\n                        tindex2 = 2;\n                        g->preflag = 1;\n                    }\n                }\n                j = 0;\n                for(k=0;k<4;k++) {\n                    n = lsf_nsf_table[tindex2][tindex][k];\n                    sl = slen[k];\n                    if(sl){\n                        for(i=0;i<n;i++)\n                            g->scale_factors[j++] = get_bits(&s->gb, sl);\n                    }else{\n                        for(i=0;i<n;i++)\n                            g->scale_factors[j++] = 0;\n                    }\n                }\n                for(;j<40;j++)\n                    g->scale_factors[j] = 0;\n            }\n            exponents_from_scale_factors(s, g, exponents);\n            huffman_decode(s, g, exponents, bits_pos + g->part2_3_length);\n        }\n        if (s->nb_channels == 2)\n            compute_stereo(s, &s->granules[0][gr], &s->granules[1][gr]);\n        for(ch=0;ch<s->nb_channels;ch++) {\n            g = &s->granules[ch][gr];\n            reorder_block(s, g);\n            compute_antialias(s, g);\n            compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);\n        }\n    }\n    if(get_bits_count(&s->gb)<0)\n        skip_bits_long(&s->gb, -get_bits_count(&s->gb));\n    return nb_granules * 18;\n}', 'static void compute_imdct(MPADecodeContext *s,\n                          GranuleDef *g,\n                          INTFLOAT *sb_samples,\n                          INTFLOAT *mdct_buf)\n{\n    INTFLOAT *win, *win1, *out_ptr, *ptr, *buf, *ptr1;\n    INTFLOAT out2[12];\n    int i, j, mdct_long_end, sblimit;\n    ptr = g->sb_hybrid + 576;\n    ptr1 = g->sb_hybrid + 2 * 18;\n    while (ptr >= ptr1) {\n        int32_t *p;\n        ptr -= 6;\n        p= (int32_t*)ptr;\n        if(p[0] | p[1] | p[2] | p[3] | p[4] | p[5])\n            break;\n    }\n    sblimit = ((ptr - g->sb_hybrid) / 18) + 1;\n    if (g->block_type == 2) {\n        if (g->switch_point)\n            mdct_long_end = 2;\n        else\n            mdct_long_end = 0;\n    } else {\n        mdct_long_end = sblimit;\n    }\n    buf = mdct_buf;\n    ptr = g->sb_hybrid;\n    for(j=0;j<mdct_long_end;j++) {\n        out_ptr = sb_samples + j;\n        if (g->switch_point && j < 2)\n            win1 = mdct_win[0];\n        else\n            win1 = mdct_win[g->block_type];\n        win = win1 + ((4 * 36) & -(j & 1));\n        imdct36(out_ptr, buf, ptr, win);\n        out_ptr += 18*SBLIMIT;\n        ptr += 18;\n        buf += 18;\n    }\n    for(j=mdct_long_end;j<sblimit;j++) {\n        win = mdct_win[2] + ((4 * 36) & -(j & 1));\n        out_ptr = sb_samples + j;\n        for(i=0; i<6; i++){\n            *out_ptr = buf[i];\n            out_ptr += SBLIMIT;\n        }\n        imdct12(out2, ptr + 0);\n        for(i=0;i<6;i++) {\n            *out_ptr     = MULH3(out2[i    ], win[i    ], 1) + buf[i + 6*1];\n            buf[i + 6*2] = MULH3(out2[i + 6], win[i + 6], 1);\n            out_ptr += SBLIMIT;\n        }\n        imdct12(out2, ptr + 1);\n        for(i=0;i<6;i++) {\n            *out_ptr     = MULH3(out2[i    ], win[i    ], 1) + buf[i + 6*2];\n            buf[i + 6*0] = MULH3(out2[i + 6], win[i + 6], 1);\n            out_ptr += SBLIMIT;\n        }\n        imdct12(out2, ptr + 2);\n        for(i=0;i<6;i++) {\n            buf[i + 6*0] = MULH3(out2[i    ], win[i    ], 1) + buf[i + 6*0];\n            buf[i + 6*1] = MULH3(out2[i + 6], win[i + 6], 1);\n            buf[i + 6*2] = 0;\n        }\n        ptr += 18;\n        buf += 18;\n    }\n    for(j=sblimit;j<SBLIMIT;j++) {\n        out_ptr = sb_samples + j;\n        for(i=0;i<18;i++) {\n            *out_ptr = buf[i];\n            buf[i] = 0;\n            out_ptr += SBLIMIT;\n        }\n        buf += 18;\n    }\n}', 'static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win)\n{\n    int i, j;\n    INTFLOAT t0, t1, t2, t3, s0, s1, s2, s3;\n    INTFLOAT tmp[18], *tmp1, *in1;\n    for(i=17;i>=1;i--)\n        in[i] += in[i-1];\n    for(i=17;i>=3;i-=2)\n        in[i] += in[i-2];\n    for(j=0;j<2;j++) {\n        tmp1 = tmp + j;\n        in1 = in + j;\n        t2 = in1[2*4] + in1[2*8] - in1[2*2];\n        t3 = in1[2*0] + SHR(in1[2*6],1);\n        t1 = in1[2*0] - in1[2*6];\n        tmp1[ 6] = t1 - SHR(t2,1);\n        tmp1[16] = t1 + t2;\n        t0 = MULH3(in1[2*2] + in1[2*4] ,    C2, 2);\n        t1 = MULH3(in1[2*4] - in1[2*8] , -2*C8, 1);\n        t2 = MULH3(in1[2*2] + in1[2*8] ,   -C4, 2);\n        tmp1[10] = t3 - t0 - t2;\n        tmp1[ 2] = t3 + t0 + t1;\n        tmp1[14] = t3 + t2 - t1;\n        tmp1[ 4] = MULH3(in1[2*5] + in1[2*7] - in1[2*1], -C3, 2);\n        t2 = MULH3(in1[2*1] + in1[2*5],    C1, 2);\n        t3 = MULH3(in1[2*5] - in1[2*7], -2*C7, 1);\n        t0 = MULH3(in1[2*3], C3, 2);\n        t1 = MULH3(in1[2*1] + in1[2*7],   -C5, 2);\n        tmp1[ 0] = t2 + t3 + t0;\n        tmp1[12] = t2 + t1 - t0;\n        tmp1[ 8] = t3 - t1 - t0;\n    }\n    i = 0;\n    for(j=0;j<4;j++) {\n        t0 = tmp[i];\n        t1 = tmp[i + 2];\n        s0 = t1 + t0;\n        s2 = t1 - t0;\n        t2 = tmp[i + 1];\n        t3 = tmp[i + 3];\n        s1 = MULH3(t3 + t2, icos36h[j], 2);\n        s3 = MULLx(t3 - t2, icos36[8 - j], FRAC_BITS);\n        t0 = s0 + s1;\n        t1 = s0 - s1;\n        out[(9 + j)*SBLIMIT] =  MULH3(t1, win[9 + j], 1) + buf[9 + j];\n        out[(8 - j)*SBLIMIT] =  MULH3(t1, win[8 - j], 1) + buf[8 - j];\n        buf[9 + j] = MULH3(t0, win[18 + 9 + j], 1);\n        buf[8 - j] = MULH3(t0, win[18 + 8 - j], 1);\n        t0 = s2 + s3;\n        t1 = s2 - s3;\n        out[(9 + 8 - j)*SBLIMIT] =  MULH3(t1, win[9 + 8 - j], 1) + buf[9 + 8 - j];\n        out[(        j)*SBLIMIT] =  MULH3(t1, win[        j], 1) + buf[        j];\n        buf[9 + 8 - j] = MULH3(t0, win[18 + 9 + 8 - j], 1);\n        buf[      + j] = MULH3(t0, win[18         + j], 1);\n        i += 4;\n    }\n    s0 = tmp[16];\n    s1 = MULH3(tmp[17], icos36h[4], 2);\n    t0 = s0 + s1;\n    t1 = s0 - s1;\n    out[(9 + 4)*SBLIMIT] =  MULH3(t1, win[9 + 4], 1) + buf[9 + 4];\n    out[(8 - 4)*SBLIMIT] =  MULH3(t1, win[8 - 4], 1) + buf[8 - 4];\n    buf[9 + 4] = MULH3(t0, win[18 + 9 + 4], 1);\n    buf[8 - 4] = MULH3(t0, win[18 + 8 - 4], 1);\n}']