libavcodec/ps.c:825: error: Buffer Overrun L1
  Offset: [33, `ps->num_env` + 32] (⇐ [0, `ps->num_env` - 1] + 33) Size: 5 by call to `remap34`.

libavcodec/ps.c:794:1: Parameter `ps->num_env`
792. }
793. 
794. static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)
     ^
795. {
796.     int e, b, k, n;

libavcodec/ps.c:825:9: Call
823.     memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
824.     if (is34) {
825.         remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
             ^
826.         remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
827.         if (ps->enable_ipdopd) {

libavcodec/ps.c:756:1: Parameter `num_env`
  754. }
  755. 
  756. static void remap34(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
       ^
  757.                     int8_t           (*par)[PS_MAX_NR_IIDICC],
  758.                     int num_par, int num_env, int full)

libavcodec/ps.c:764:13: Call
  762.     if (num_par == 20 || num_par == 11) {
  763.         for (e = 0; e < num_env; e++) {
  764.             map_idx_20_to_34(par_mapped[e], par[e], full);
                   ^
  765.         }
  766.     } else if (num_par == 10 || num_par == 5) {

libavcodec/ps.c:567:1: <Length trace>
565. }
566. 
567. static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
     ^
568. {
569.     if (full) {

libavcodec/ps.c:567:1: Parameter `*par_mapped`
    565. }
    566. 
    567. static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
         ^
    568. {
    569.     if (full) {

libavcodec/ps.c:570:9: Array access: Offset: [33, ps->num_env + 32] (⇐ [0, ps->num_env - 1] + 33) Size: 5 by call to `remap34` 
    568. {
    569.     if (full) {
    570.         par_mapped[33] =  par[19];
                 ^
    571.         par_mapped[32] =  par[19];
    572.         par_mapped[31] =  par[18];

static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
{
    if (full) {
        par_mapped[33] =  par[19];
        par_mapped[32] =  par[19];
        par_mapped[31] =  par[18];
        par_mapped[30] =  par[18];
        par_mapped[29] =  par[18];
        par_mapped[28] =  par[18];
        par_mapped[27] =  par[17];
        par_mapped[26] =  par[17];
        par_mapped[25] =  par[16];
        par_mapped[24] =  par[16];
        par_mapped[23] =  par[15];
        par_mapped[22] =  par[15];
        par_mapped[21] =  par[14];
        par_mapped[20] =  par[14];
        par_mapped[19] =  par[13];
        par_mapped[18] =  par[12];
        par_mapped[17] =  par[11];
    }
    par_mapped[16] =  par[10];
    par_mapped[15] =  par[ 9];
    par_mapped[14] =  par[ 9];
    par_mapped[13] =  par[ 8];
    par_mapped[12] =  par[ 8];
    par_mapped[11] =  par[ 7];
    par_mapped[10] =  par[ 6];
    par_mapped[ 9] =  par[ 5];
    par_mapped[ 8] =  par[ 5];
    par_mapped[ 7] =  par[ 4];
    par_mapped[ 6] =  par[ 4];
    par_mapped[ 5] =  par[ 3];
    par_mapped[ 4] = (par[ 2] + par[ 3]) / 2;
    par_mapped[ 3] =  par[ 2];
    par_mapped[ 2] =  par[ 1];
    par_mapped[ 1] = (par[ 0] + par[ 1]) / 2;
    par_mapped[ 0] =  par[ 0];
}
['static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)\n{\n    int e, b, k, n;\n    float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;\n    float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;\n    float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;\n    float (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22;\n    int8_t *opd_hist = ps->opd_hist;\n    int8_t *ipd_hist = ps->ipd_hist;\n    int8_t iid_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];\n    int8_t icc_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];\n    int8_t ipd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];\n    int8_t opd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];\n    int8_t (*iid_mapped)[PS_MAX_NR_IIDICC] = iid_mapped_buf;\n    int8_t (*icc_mapped)[PS_MAX_NR_IIDICC] = icc_mapped_buf;\n    int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf;\n    int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf;\n    const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;\n    const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;\n    memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));\n    memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));\n    memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));\n    memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));\n    memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));\n    memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));\n    memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));\n    memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));\n    if (is34) {\n        remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);\n        remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);\n        if (ps->enable_ipdopd) {\n            remap34(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);\n            remap34(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);\n        }\n        if (!ps->is34bands_old) {\n            map_val_20_to_34(H11[0][0]);\n            map_val_20_to_34(H11[1][0]);\n            map_val_20_to_34(H12[0][0]);\n            map_val_20_to_34(H12[1][0]);\n            map_val_20_to_34(H21[0][0]);\n            map_val_20_to_34(H21[1][0]);\n            map_val_20_to_34(H22[0][0]);\n            map_val_20_to_34(H22[1][0]);\n            ipdopd_reset(ipd_hist, opd_hist);\n        }\n    } else {\n        remap20(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);\n        remap20(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);\n        if (ps->enable_ipdopd) {\n            remap20(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);\n            remap20(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);\n        }\n        if (ps->is34bands_old) {\n            map_val_34_to_20(H11[0][0]);\n            map_val_34_to_20(H11[1][0]);\n            map_val_34_to_20(H12[0][0]);\n            map_val_34_to_20(H12[1][0]);\n            map_val_34_to_20(H21[0][0]);\n            map_val_34_to_20(H21[1][0]);\n            map_val_34_to_20(H22[0][0]);\n            map_val_34_to_20(H22[1][0]);\n            ipdopd_reset(ipd_hist, opd_hist);\n        }\n    }\n    for (e = 0; e < ps->num_env; e++) {\n        for (b = 0; b < NR_PAR_BANDS[is34]; b++) {\n            float h11, h12, h21, h22;\n            h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0];\n            h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];\n            h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];\n            h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];\n            if (!PS_BASELINE && ps->enable_ipdopd && b < ps->nr_ipdopd_par) {\n                float h11i, h12i, h21i, h22i;\n                float ipd_adj_re, ipd_adj_im;\n                int opd_idx = opd_hist[b] * 8 + opd_mapped[e][b];\n                int ipd_idx = ipd_hist[b] * 8 + ipd_mapped[e][b];\n                float opd_re = pd_re_smooth[opd_idx];\n                float opd_im = pd_im_smooth[opd_idx];\n                float ipd_re = pd_re_smooth[ipd_idx];\n                float ipd_im = pd_im_smooth[ipd_idx];\n                opd_hist[b] = opd_idx & 0x3F;\n                ipd_hist[b] = ipd_idx & 0x3F;\n                ipd_adj_re = opd_re*ipd_re + opd_im*ipd_im;\n                ipd_adj_im = opd_im*ipd_re - opd_re*ipd_im;\n                h11i = h11 * opd_im;\n                h11  = h11 * opd_re;\n                h12i = h12 * ipd_adj_im;\n                h12  = h12 * ipd_adj_re;\n                h21i = h21 * opd_im;\n                h21  = h21 * opd_re;\n                h22i = h22 * ipd_adj_im;\n                h22  = h22 * ipd_adj_re;\n                H11[1][e+1][b] = h11i;\n                H12[1][e+1][b] = h12i;\n                H21[1][e+1][b] = h21i;\n                H22[1][e+1][b] = h22i;\n            }\n            H11[0][e+1][b] = h11;\n            H12[0][e+1][b] = h12;\n            H21[0][e+1][b] = h21;\n            H22[0][e+1][b] = h22;\n        }\n        for (k = 0; k < NR_BANDS[is34]; k++) {\n            float h11r, h12r, h21r, h22r;\n            float h11i, h12i, h21i, h22i;\n            float h11r_step, h12r_step, h21r_step, h22r_step;\n            float h11i_step, h12i_step, h21i_step, h22i_step;\n            int start = ps->border_position[e];\n            int stop  = ps->border_position[e+1];\n            float width = 1.f / (stop - start);\n            b = k_to_i[k];\n            h11r = H11[0][e][b];\n            h12r = H12[0][e][b];\n            h21r = H21[0][e][b];\n            h22r = H22[0][e][b];\n            if (!PS_BASELINE && ps->enable_ipdopd) {\n            if ((is34 && k <= 13 && k >= 9) || (!is34 && k <= 1)) {\n                h11i = -H11[1][e][b];\n                h12i = -H12[1][e][b];\n                h21i = -H21[1][e][b];\n                h22i = -H22[1][e][b];\n            } else {\n                h11i = H11[1][e][b];\n                h12i = H12[1][e][b];\n                h21i = H21[1][e][b];\n                h22i = H22[1][e][b];\n            }\n            }\n            h11r_step = (H11[0][e+1][b] - h11r) * width;\n            h12r_step = (H12[0][e+1][b] - h12r) * width;\n            h21r_step = (H21[0][e+1][b] - h21r) * width;\n            h22r_step = (H22[0][e+1][b] - h22r) * width;\n            if (!PS_BASELINE && ps->enable_ipdopd) {\n                h11i_step = (H11[1][e+1][b] - h11i) * width;\n                h12i_step = (H12[1][e+1][b] - h12i) * width;\n                h21i_step = (H21[1][e+1][b] - h21i) * width;\n                h22i_step = (H22[1][e+1][b] - h22i) * width;\n            }\n            for (n = start + 1; n <= stop; n++) {\n                float l_re = l[k][n][0];\n                float l_im = l[k][n][1];\n                float r_re = r[k][n][0];\n                float r_im = r[k][n][1];\n                h11r += h11r_step;\n                h12r += h12r_step;\n                h21r += h21r_step;\n                h22r += h22r_step;\n                if (!PS_BASELINE && ps->enable_ipdopd) {\n                    h11i += h11i_step;\n                    h12i += h12i_step;\n                    h21i += h21i_step;\n                    h22i += h22i_step;\n                    l[k][n][0] = h11r*l_re + h21r*r_re - h11i*l_im - h21i*r_im;\n                    l[k][n][1] = h11r*l_im + h21r*r_im + h11i*l_re + h21i*r_re;\n                    r[k][n][0] = h12r*l_re + h22r*r_re - h12i*l_im - h22i*r_im;\n                    r[k][n][1] = h12r*l_im + h22r*r_im + h12i*l_re + h22i*r_re;\n                } else {\n                    l[k][n][0] = h11r*l_re + h21r*r_re;\n                    l[k][n][1] = h11r*l_im + h21r*r_im;\n                    r[k][n][0] = h12r*l_re + h22r*r_re;\n                    r[k][n][1] = h12r*l_im + h22r*r_im;\n                }\n            }\n        }\n    }\n}', 'static void remap34(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],\n                    int8_t           (*par)[PS_MAX_NR_IIDICC],\n                    int num_par, int num_env, int full)\n{\n    int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped;\n    int e;\n    if (num_par == 20 || num_par == 11) {\n        for (e = 0; e < num_env; e++) {\n            map_idx_20_to_34(par_mapped[e], par[e], full);\n        }\n    } else if (num_par == 10 || num_par == 5) {\n        for (e = 0; e < num_env; e++) {\n            map_idx_10_to_34(par_mapped[e], par[e], full);\n        }\n    } else {\n        *p_par_mapped = par;\n    }\n}', 'static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)\n{\n    if (full) {\n        par_mapped[33] =  par[19];\n        par_mapped[32] =  par[19];\n        par_mapped[31] =  par[18];\n        par_mapped[30] =  par[18];\n        par_mapped[29] =  par[18];\n        par_mapped[28] =  par[18];\n        par_mapped[27] =  par[17];\n        par_mapped[26] =  par[17];\n        par_mapped[25] =  par[16];\n        par_mapped[24] =  par[16];\n        par_mapped[23] =  par[15];\n        par_mapped[22] =  par[15];\n        par_mapped[21] =  par[14];\n        par_mapped[20] =  par[14];\n        par_mapped[19] =  par[13];\n        par_mapped[18] =  par[12];\n        par_mapped[17] =  par[11];\n    }\n    par_mapped[16] =  par[10];\n    par_mapped[15] =  par[ 9];\n    par_mapped[14] =  par[ 9];\n    par_mapped[13] =  par[ 8];\n    par_mapped[12] =  par[ 8];\n    par_mapped[11] =  par[ 7];\n    par_mapped[10] =  par[ 6];\n    par_mapped[ 9] =  par[ 5];\n    par_mapped[ 8] =  par[ 5];\n    par_mapped[ 7] =  par[ 4];\n    par_mapped[ 6] =  par[ 4];\n    par_mapped[ 5] =  par[ 3];\n    par_mapped[ 4] = (par[ 2] + par[ 3]) / 2;\n    par_mapped[ 3] =  par[ 2];\n    par_mapped[ 2] =  par[ 1];\n    par_mapped[ 1] = (par[ 0] + par[ 1]) / 2;\n    par_mapped[ 0] =  par[ 0];\n}']