libavcodec/dca.c:1056: 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:912:1: Parameter `s->prim_channels`
910. static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 };
911. 
912. static int dca_subsubframe(DCAContext * s)
     ^
913. {
914.     int k, l;

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

libavcodec/dca.c:750:1: Parameter `chans`
  748. }
  749. 
  750. static void qmf_32_subbands(DCAContext * s, int chans,
       ^
  751.                             float samples_in[32][8], float *samples_out,
  752.                             float scale, float bias)

libavcodec/dca.c:777:9: Call
  775.             s->raXin[i] = 0.0;
  776. 
  777.         ff_synth_filter_float(&s->imdct,
               ^
  778.                               s->subband_fir_hist[chans], &s->hist_index[chans],
  779.                               s->subband_fir_noidea[chans], prCoeff,

libavcodec/synth_filter.c:33:10: <Offset trace>
31.     ff_imdct_half(imdct, synth_buf, in);
32. 
33.     for (i = 0; i < 16; i++){
             ^
34.         float a= synth_buf2[i     ];
35.         float b= synth_buf2[i + 16];

libavcodec/synth_filter.c:33:10: Assignment
    31.     ff_imdct_half(imdct, synth_buf, in);
    32. 
    33.     for (i = 0; i < 16; i++){
                 ^
    34.         float a= synth_buf2[i     ];
    35.         float b= synth_buf2[i + 16];

libavcodec/synth_filter.c:23:1: <Length trace>
21. #include "synth_filter.h"
22. 
23. void ff_synth_filter_float(FFTContext *imdct,
    ^
24.                            float *synth_buf_ptr, int *synth_buf_offset,
25.                            float synth_buf2[32], const float window[512],

libavcodec/synth_filter.c:23:1: Parameter `*synth_buf2`
    21. #include "synth_filter.h"
    22. 
    23. void ff_synth_filter_float(FFTContext *imdct,
        ^
    24.                            float *synth_buf_ptr, int *synth_buf_offset,
    25.                            float synth_buf2[32], const float window[512],

libavcodec/synth_filter.c:53:9: Array access: Offset: [16, s->prim_channels + 30] (⇐ [0, s->prim_channels - 1] + [16, 31]) Size: 5 by call to `qmf_32_subbands` 
    51.         out[i + 16] = b*scale + bias;
    52.         synth_buf2[i     ] = c;
    53.         synth_buf2[i + 16] = d;
                ^
    54.     }
    55.     *synth_buf_offset= (*synth_buf_offset - 32)&511;

void ff_synth_filter_float(FFTContext *imdct,
                           float *synth_buf_ptr, int *synth_buf_offset,
                           float synth_buf2[32], const float window[512],
                           float out[32], const float in[32], float scale, float bias)
{
    float *synth_buf= synth_buf_ptr + *synth_buf_offset;
    int i, j;
    ff_imdct_half(imdct, synth_buf, in);
    for (i = 0; i < 16; i++){
        float a= synth_buf2[i     ];
        float b= synth_buf2[i + 16];
        float c= 0;
        float d= 0;
        for (j = 0; j < 512 - *synth_buf_offset; j += 64){
            a += window[i + j     ]*(-synth_buf[15 - i + j      ]);
            b += window[i + j + 16]*( synth_buf[     i + j      ]);
            c += window[i + j + 32]*( synth_buf[16 + i + j      ]);
            d += window[i + j + 48]*( synth_buf[31 - i + j      ]);
        }
        for (     ; j < 512; j += 64){
            a += window[i + j     ]*(-synth_buf[15 - i + j - 512]);
            b += window[i + j + 16]*( synth_buf[     i + j - 512]);
            c += window[i + j + 32]*( synth_buf[16 + i + j - 512]);
            d += window[i + j + 48]*( synth_buf[31 - i + j - 512]);
        }
        out[i     ] = a*scale + bias;
        out[i + 16] = b*scale + bias;
        synth_buf2[i     ] = c;
        synth_buf2[i + 16] = d;
    }
    *synth_buf_offset= (*synth_buf_offset - 32)&511;
}
['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;\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        for (i = 0; i < s->subband_activity[chans]; i++){\n            if((i-1)&2) s->raXin[i] = -samples_in[i][subindex];\n            else        s->raXin[i] =  samples_in[i][subindex];\n        }\n        for (; i < 32; i++)\n            s->raXin[i] = 0.0;\n        ff_synth_filter_float(&s->imdct,\n                              s->subband_fir_hist[chans], &s->hist_index[chans],\n                              s->subband_fir_noidea[chans], prCoeff,\n                              samples_out, s->raXin, scale, bias);\n        samples_out+= 32;\n    }\n}', 'void ff_synth_filter_float(FFTContext *imdct,\n                           float *synth_buf_ptr, int *synth_buf_offset,\n                           float synth_buf2[32], const float window[512],\n                           float out[32], const float in[32], float scale, float bias)\n{\n    float *synth_buf= synth_buf_ptr + *synth_buf_offset;\n    int i, j;\n    ff_imdct_half(imdct, synth_buf, in);\n    for (i = 0; i < 16; i++){\n        float a= synth_buf2[i     ];\n        float b= synth_buf2[i + 16];\n        float c= 0;\n        float d= 0;\n        for (j = 0; j < 512 - *synth_buf_offset; j += 64){\n            a += window[i + j     ]*(-synth_buf[15 - i + j      ]);\n            b += window[i + j + 16]*( synth_buf[     i + j      ]);\n            c += window[i + j + 32]*( synth_buf[16 + i + j      ]);\n            d += window[i + j + 48]*( synth_buf[31 - i + j      ]);\n        }\n        for (     ; j < 512; j += 64){\n            a += window[i + j     ]*(-synth_buf[15 - i + j - 512]);\n            b += window[i + j + 16]*( synth_buf[     i + j - 512]);\n            c += window[i + j + 32]*( synth_buf[16 + i + j - 512]);\n            d += window[i + j + 48]*( synth_buf[31 - i + j - 512]);\n        }\n        out[i     ] = a*scale + bias;\n        out[i + 16] = b*scale + bias;\n        synth_buf2[i     ] = c;\n        synth_buf2[i + 16] = d;\n    }\n    *synth_buf_offset= (*synth_buf_offset - 32)&511;\n}']