libavcodec/dca.c:1059: error: Buffer Overrun L1
  Offset: [16, `s->prim_channels` + 30] (⇐ [0, `s->prim_channels` - 1] + [16, 31]) Size: 5 by call to `qmf_32_subbands`.

libavcodec/dca.c:915:1: Parameter `s->prim_channels`
913. static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 };
914. 
915. static int dca_subsubframe(DCAContext * s)
     ^
916. {
917.     int k, l;

libavcodec/dca.c:1059:10: Call
1057. /*        static float pcm_to_double[8] =
1058.             {32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/
1059.          qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * s->channel_order_tab[k]],
               ^
1060.                             M_SQRT1_2*s->scale_bias /*pcm_to_double[s->source_pcm_res] */ ,
1061.                             s->add_bias );

libavcodec/dca.c:760:14: <Offset trace>
758. 
759.         /* Multiply by filter coefficients */
760.         for (i = 0; i < 16; i++){
                  ^
761.             float a= subband_fir_hist2[i   ];
762.             float b= subband_fir_hist2[i+16];

libavcodec/dca.c:760:14: Assignment
  758. 
  759.         /* Multiply by filter coefficients */
  760.         for (i = 0; i < 16; i++){
                    ^
  761.             float a= subband_fir_hist2[i   ];
  762.             float b= subband_fir_hist2[i+16];

libavcodec/dca.c:725:1: <Length trace>
723. }
724. 
725. static void qmf_32_subbands(DCAContext * s, int chans,
     ^
726.                             float samples_in[32][8], float *samples_out,
727.                             float scale, float bias)

libavcodec/dca.c:725:1: Parameter `chans`
  723. }
  724. 
  725. static void qmf_32_subbands(DCAContext * s, int chans,
       ^
  726.                             float samples_in[32][8], float *samples_out,
  727.                             float scale, float bias)

libavcodec/dca.c:734:5: Assignment
  732. 
  733.     int hist_index= s->hist_index[chans];
  734.     float *subband_fir_hist2 = s->subband_fir_noidea[chans];
           ^
  735. 
  736.     int subindex;

libavcodec/dca.c:762:22: Array access: Offset: [16, s->prim_channels + 30] (⇐ [0, s->prim_channels - 1] + [16, 31]) Size: 5 by call to `qmf_32_subbands` 
  760.         for (i = 0; i < 16; i++){
  761.             float a= subband_fir_hist2[i   ];
  762.             float b= subband_fir_hist2[i+16];
                            ^
  763.             float c= 0;
  764.             float d= 0;

static void qmf_32_subbands(DCAContext * s, int chans,
                            float samples_in[32][8], float *samples_out,
                            float scale, float bias)
{
    const float *prCoeff;
    int i, j;
    DECLARE_ALIGNED_16(float, raXin[32]);
    int hist_index= s->hist_index[chans];
    float *subband_fir_hist2 = s->subband_fir_noidea[chans];
    int subindex;
    scale *= sqrt(1/8.0);
    if (!s->multirate_inter)
        prCoeff = fir_32bands_nonperfect;
    else
        prCoeff = fir_32bands_perfect;
    for (subindex = 0; subindex < 8; subindex++) {
        float *subband_fir_hist = s->subband_fir_hist[chans] + hist_index;
        for (i = 0; i < s->subband_activity[chans]; i++){
            if((i-1)&2) raXin[i] = -samples_in[i][subindex];
            else        raXin[i] =  samples_in[i][subindex];
        }
        for (; i < 32; i++)
            raXin[i] = 0.0;
        ff_imdct_half(&s->imdct, subband_fir_hist, raXin);
        for (i = 0; i < 16; i++){
            float a= subband_fir_hist2[i   ];
            float b= subband_fir_hist2[i+16];
            float c= 0;
            float d= 0;
            for (j = 0; j < 512-hist_index; j += 64){
                a += prCoeff[i+j   ]*(-subband_fir_hist[15-i+j]);
                b += prCoeff[i+j+16]*( subband_fir_hist[   i+j]);
                c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j]);
                d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j]);
            }
            for (     ; j < 512; j += 64){
                a += prCoeff[i+j   ]*(-subband_fir_hist[15-i+j-512]);
                b += prCoeff[i+j+16]*( subband_fir_hist[   i+j-512]);
                c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j-512]);
                d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j-512]);
            }
            samples_out[i   ] = a * scale + bias;
            samples_out[i+16] = b * scale + bias;
            subband_fir_hist2[i   ] = c;
            subband_fir_hist2[i+16] = d;
        }
        samples_out+= 32;
        hist_index = (hist_index-32)&511;
    }
    s->hist_index[chans]= hist_index;
}
['static int dca_subsubframe(DCAContext * s)\n{\n    int k, l;\n    int subsubframe = s->current_subsubframe;\n    const float *quant_step_table;\n    float subband_samples[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8];\n    if (s->bit_rate_index == 0x1f)\n        quant_step_table = lossless_quant_d;\n    else\n        quant_step_table = lossy_quant_d;\n    for (k = 0; k < s->prim_channels; k++) {\n        for (l = 0; l < s->vq_start_subband[k]; l++) {\n            int m;\n            int abits = s->bitalloc[k][l];\n            float quant_step_size = quant_step_table[abits];\n            float rscale;\n            int sel = s->quant_index_huffman[k][abits];\n            if(!abits){\n                memset(subband_samples[k][l], 0, 8 * sizeof(subband_samples[0][0][0]));\n            }else if(abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){\n                if(abits <= 7){\n                    int block_code1, block_code2, size, levels;\n                    int block[8];\n                    size = abits_sizes[abits-1];\n                    levels = abits_levels[abits-1];\n                    block_code1 = get_bits(&s->gb, size);\n                    decode_blockcode(block_code1, levels, block);\n                    block_code2 = get_bits(&s->gb, size);\n                    decode_blockcode(block_code2, levels, &block[4]);\n                    for (m = 0; m < 8; m++)\n                        subband_samples[k][l][m] = block[m];\n                }else{\n                    for (m = 0; m < 8; m++)\n                        subband_samples[k][l][m] = get_sbits(&s->gb, abits - 3);\n                }\n            }else{\n                for (m = 0; m < 8; m++)\n                    subband_samples[k][l][m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel);\n            }\n            if (s->transition_mode[k][l] &&\n                subsubframe >= s->transition_mode[k][l])\n                rscale = quant_step_size * s->scale_factor[k][l][1];\n            else\n                rscale = quant_step_size * s->scale_factor[k][l][0];\n            rscale *= s->scalefactor_adj[k][sel];\n            for (m = 0; m < 8; m++)\n                subband_samples[k][l][m] *= rscale;\n            if (s->prediction_mode[k][l]) {\n                int n;\n                for (m = 0; m < 8; m++) {\n                    for (n = 1; n <= 4; n++)\n                        if (m >= n)\n                            subband_samples[k][l][m] +=\n                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *\n                                 subband_samples[k][l][m - n] / 8192);\n                        else if (s->predictor_history)\n                            subband_samples[k][l][m] +=\n                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *\n                                 s->subband_samples_hist[k][l][m - n +\n                                                               4] / 8192);\n                }\n            }\n        }\n        for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {\n            int m;\n            if (!s->debug_flag & 0x01) {\n                av_log(s->avctx, AV_LOG_DEBUG, "Stream with high frequencies VQ coding\\n");\n                s->debug_flag |= 0x01;\n            }\n            for (m = 0; m < 8; m++) {\n                subband_samples[k][l][m] =\n                    high_freq_vq[s->high_freq_vq[k][l]][subsubframe * 8 +\n                                                        m]\n                    * (float) s->scale_factor[k][l][0] / 16.0;\n            }\n        }\n    }\n    if (s->aspf || subsubframe == s->subsubframes - 1) {\n        if (0xFFFF == get_bits(&s->gb, 16)) {\n#ifdef TRACE\n            av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\\n");\n#endif\n        } else {\n            av_log(s->avctx, AV_LOG_ERROR, "Didn\'t get subframe DSYNC\\n");\n        }\n    }\n    for (k = 0; k < s->prim_channels; k++)\n        for (l = 0; l < s->vq_start_subband[k]; l++)\n            memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4],\n                        4 * sizeof(subband_samples[0][0][0]));\n    for (k = 0; k < s->prim_channels; k++) {\n         qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * s->channel_order_tab[k]],\n                            M_SQRT1_2*s->scale_bias   ,\n                            s->add_bias );\n    }\n    if (s->prim_channels > dca_channels[s->output & DCA_CHANNEL_MASK]) {\n        dca_downmix(s->samples, s->amode, s->downmix_coef);\n    }\n    if (s->output & DCA_LFE) {\n        int lfe_samples = 2 * s->lfe * s->subsubframes;\n        lfe_interpolation_fir(s->lfe, 2 * s->lfe,\n                              s->lfe_data + lfe_samples +\n                              2 * s->lfe * subsubframe,\n                              &s->samples[256 * dca_lfe_index[s->amode]],\n                              (1.0/256.0)*s->scale_bias,  s->add_bias);\n    }\n    return 0;\n}', 'static void qmf_32_subbands(DCAContext * s, int chans,\n                            float samples_in[32][8], float *samples_out,\n                            float scale, float bias)\n{\n    const float *prCoeff;\n    int i, j;\n    DECLARE_ALIGNED_16(float, raXin[32]);\n    int hist_index= s->hist_index[chans];\n    float *subband_fir_hist2 = s->subband_fir_noidea[chans];\n    int subindex;\n    scale *= sqrt(1/8.0);\n    if (!s->multirate_inter)\n        prCoeff = fir_32bands_nonperfect;\n    else\n        prCoeff = fir_32bands_perfect;\n    for (subindex = 0; subindex < 8; subindex++) {\n        float *subband_fir_hist = s->subband_fir_hist[chans] + hist_index;\n        for (i = 0; i < s->subband_activity[chans]; i++){\n            if((i-1)&2) raXin[i] = -samples_in[i][subindex];\n            else        raXin[i] =  samples_in[i][subindex];\n        }\n        for (; i < 32; i++)\n            raXin[i] = 0.0;\n        ff_imdct_half(&s->imdct, subband_fir_hist, raXin);\n        for (i = 0; i < 16; i++){\n            float a= subband_fir_hist2[i   ];\n            float b= subband_fir_hist2[i+16];\n            float c= 0;\n            float d= 0;\n            for (j = 0; j < 512-hist_index; j += 64){\n                a += prCoeff[i+j   ]*(-subband_fir_hist[15-i+j]);\n                b += prCoeff[i+j+16]*( subband_fir_hist[   i+j]);\n                c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j]);\n                d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j]);\n            }\n            for (     ; j < 512; j += 64){\n                a += prCoeff[i+j   ]*(-subband_fir_hist[15-i+j-512]);\n                b += prCoeff[i+j+16]*( subband_fir_hist[   i+j-512]);\n                c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j-512]);\n                d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j-512]);\n            }\n            samples_out[i   ] = a * scale + bias;\n            samples_out[i+16] = b * scale + bias;\n            subband_fir_hist2[i   ] = c;\n            subband_fir_hist2[i+16] = d;\n        }\n        samples_out+= 32;\n        hist_index = (hist_index-32)&511;\n    }\n    s->hist_index[chans]= hist_index;\n}']