libavcodec/dca.c:1166: error: Buffer Overrun L2
  Offset: [0, 6] Size: 4.

libavcodec/dca.c:1157:22: <Offset trace>
1155.             if (s->prediction_mode[k][l]) {
1156.                 int n;
1157.                 for (m = 0; m < 8; m++) {
                           ^
1158.                     for (n = 1; n <= 4; n++)
1159.                         if (m >= n)

libavcodec/dca.c:1157:22: Assignment
1155.             if (s->prediction_mode[k][l]) {
1156.                 int n;
1157.                 for (m = 0; m < 8; m++) {
                           ^
1158.                     for (n = 1; n <= 4; n++)
1159.                         if (m >= n)

libavcodec/dca.c:1074:1: <Length trace>
1072. #endif
1073. 
1074. static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)
      ^
1075. {
1076.     int k, l;

libavcodec/dca.c:1074:1: Parameter `s->subband_samples_hist[*][*][*]`
1072. #endif
1073. 
1074. static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)
      ^
1075. {
1076.     int k, l;

libavcodec/dca.c:1166:34: Array access: Offset: [0, 6] Size: 4
1164.                             subband_samples[k][l][m] +=
1165.                                 (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
1166.                                  s->subband_samples_hist[k][l][m - n +
                                       ^
1167.                                                                4] / 8192);
1168.                 }

static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)
{
    int k, l;
    int subsubframe = s->current_subsubframe;
    const float *quant_step_table;
    float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
    LOCAL_ALIGNED_16(int, block, [8]);
    if (s->bit_rate_index == 0x1f)
        quant_step_table = lossless_quant_d;
    else
        quant_step_table = lossy_quant_d;
    for (k = base_channel; k < s->prim_channels; k++) {
        if (get_bits_left(&s->gb) < 0)
            return -1;
        for (l = 0; l < s->vq_start_subband[k]; l++) {
            int m;
            int abits = s->bitalloc[k][l];
            float quant_step_size = quant_step_table[abits];
            int sel = s->quant_index_huffman[k][abits];
            if (!abits){
                memset(subband_samples[k][l], 0, 8 * sizeof(subband_samples[0][0][0]));
            } else {
                int sfi = s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l];
                float rscale = quant_step_size * s->scale_factor[k][l][sfi] * s->scalefactor_adj[k][sel];
                if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){
                    if (abits <= 7){
                        int block_code1, block_code2, size, levels;
                        size = abits_sizes[abits-1];
                        levels = abits_levels[abits-1];
                        block_code1 = get_bits(&s->gb, size);
                        decode_blockcode(block_code1, levels, block);
                        block_code2 = get_bits(&s->gb, size);
                        decode_blockcode(block_code2, levels, &block[4]);
                    }else{
                        for (m = 0; m < 8; m++)
                            block[m] = get_sbits(&s->gb, abits - 3);
                    }
                }else{
                    for (m = 0; m < 8; m++)
                        block[m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel);
                }
                s->fmt_conv.int32_to_float_fmul_scalar(subband_samples[k][l],
                                                  block, rscale, 8);
            }
            if (s->prediction_mode[k][l]) {
                int n;
                for (m = 0; m < 8; m++) {
                    for (n = 1; n <= 4; n++)
                        if (m >= n)
                            subband_samples[k][l][m] +=
                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
                                 subband_samples[k][l][m - n] / 8192);
                        else if (s->predictor_history)
                            subband_samples[k][l][m] +=
                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
                                 s->subband_samples_hist[k][l][m - n +
                                                               4] / 8192);
                }
            }
        }
        for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {
            int hfvq = s->high_freq_vq[k][l];
            if (!s->debug_flag & 0x01) {
                av_log(s->avctx, AV_LOG_DEBUG, "Stream with high frequencies VQ coding\n");
                s->debug_flag |= 0x01;
            }
            int8x8_fmul_int32(subband_samples[k][l],
                              &high_freq_vq[hfvq][subsubframe * 8],
                              s->scale_factor[k][l][0]);
        }
    }
    if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {
        if (0xFFFF == get_bits(&s->gb, 16)) {
#ifdef TRACE
            av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\n");
#endif
        } else {
            av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
        }
    }
    for (k = base_channel; k < s->prim_channels; k++)
        for (l = 0; l < s->vq_start_subband[k]; l++)
            memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4],
                        4 * sizeof(subband_samples[0][0][0]));
    return 0;
}
['static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)\n{\n    int k, l;\n    int subsubframe = s->current_subsubframe;\n    const float *quant_step_table;\n    float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];\n    LOCAL_ALIGNED_16(int, block, [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 = base_channel; k < s->prim_channels; k++) {\n        if (get_bits_left(&s->gb) < 0)\n            return -1;\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            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 {\n                int sfi = s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l];\n                float rscale = quant_step_size * s->scale_factor[k][l][sfi] * s->scalefactor_adj[k][sel];\n                if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){\n                    if (abits <= 7){\n                        int block_code1, block_code2, size, levels;\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                    }else{\n                        for (m = 0; m < 8; m++)\n                            block[m] = get_sbits(&s->gb, abits - 3);\n                    }\n                }else{\n                    for (m = 0; m < 8; m++)\n                        block[m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel);\n                }\n                s->fmt_conv.int32_to_float_fmul_scalar(subband_samples[k][l],\n                                                  block, rscale, 8);\n            }\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 hfvq = s->high_freq_vq[k][l];\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            int8x8_fmul_int32(subband_samples[k][l],\n                              &high_freq_vq[hfvq][subsubframe * 8],\n                              s->scale_factor[k][l][0]);\n        }\n    }\n    if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 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 = base_channel; 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    return 0;\n}']