libavcodec/cinepakenc.c:806: error: Buffer Overrun L2
  Offset: [9, 35] (⇐ [0, 20] + [9, 15]) Size: 24 by call to `decode_v1_vector`.

libavcodec/cinepakenc.c:785:5: Assignment
783.     // set up vq_data, which contains a single MB
784.     vq_data[0]     = vq_pict_buf;
785.     vq_linesize[0] = MB_SIZE;
         ^
786.     vq_data[1]     = &vq_pict_buf[MB_AREA];
787.     vq_data[2]     = vq_data[1] + (MB_AREA >> 2);

libavcodec/cinepakenc.c:806:17: Call
804. 
805.                 // fill in vq_data with V1 data
806.                 decode_v1_vector(s, vq_data, vq_linesize, mb->v1_vector, info);
                     ^
807. 
808.                 mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize,

libavcodec/cinepakenc.c:464:1: <Offset trace>
462. 
463. // decodes the V1 vector in mb into the 4x4 MB pointed to by data
464. static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],
     ^
465.                              int linesize[4], int v1_vector, strip_info *info)
466. {

libavcodec/cinepakenc.c:464:1: Parameter `*linesize`
  462. 
  463. // decodes the V1 vector in mb into the 4x4 MB pointed to by data
  464. static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],
       ^
  465.                              int linesize[4], int v1_vector, strip_info *info)
  466. {

libavcodec/cinepakenc.c:464:1: <Length trace>
462. 
463. // decodes the V1 vector in mb into the 4x4 MB pointed to by data
464. static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],
     ^
465.                              int linesize[4], int v1_vector, strip_info *info)
466. {

libavcodec/cinepakenc.c:464:1: Parameter `**data`
  462. 
  463. // decodes the V1 vector in mb into the 4x4 MB pointed to by data
  464. static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],
       ^
  465.                              int linesize[4], int v1_vector, strip_info *info)
  466. {

libavcodec/cinepakenc.c:487:5: Array access: Offset: [9, 35] (⇐ [0, 20] + [9, 15]) Size: 24 by call to `decode_v1_vector` 
  485.     data[0][3 + 2 * linesize[0]] =
  486.     data[0][2 + 3 * linesize[0]] =
  487.     data[0][3 + 3 * linesize[0]] = info->v1_codebook[v1_vector * entry_size + 3];
           ^
  488. 
  489.     if (s->pix_fmt == AV_PIX_FMT_RGB24) {

static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],
                             int linesize[4], int v1_vector, strip_info *info)
{
    int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;
    data[0][0] =
    data[0][1] =
    data[0][    linesize[0]] =
    data[0][1 + linesize[0]] = info->v1_codebook[v1_vector * entry_size];
    data[0][2] =
    data[0][3] =
    data[0][2 + linesize[0]] =
    data[0][3 + linesize[0]] = info->v1_codebook[v1_vector * entry_size + 1];
    data[0][    2 * linesize[0]] =
    data[0][1 + 2 * linesize[0]] =
    data[0][    3 * linesize[0]] =
    data[0][1 + 3 * linesize[0]] = info->v1_codebook[v1_vector * entry_size + 2];
    data[0][2 + 2 * linesize[0]] =
    data[0][3 + 2 * linesize[0]] =
    data[0][2 + 3 * linesize[0]] =
    data[0][3 + 3 * linesize[0]] = info->v1_codebook[v1_vector * entry_size + 3];
    if (s->pix_fmt == AV_PIX_FMT_RGB24) {
        data[1][0] =
        data[1][1] =
        data[1][    linesize[1]] =
        data[1][1 + linesize[1]] = info->v1_codebook[v1_vector * entry_size + 4];
        data[2][0] =
        data[2][1] =
        data[2][    linesize[2]] =
        data[2][1 + linesize[2]] = info->v1_codebook[v1_vector * entry_size + 5];
    }
}
['static int quantize(CinepakEncContext *s, int h, uint8_t *data[4],\n                    int linesize[4], int v1mode, strip_info *info,\n                    mb_encoding encoding)\n{\n    int x, y, i, j, k, x2, y2, x3, y3, plane, shift, mbn;\n    int entry_size      = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;\n    int *codebook       = v1mode ? info->v1_codebook : info->v4_codebook;\n    int size            = v1mode ? info->v1_size : info->v4_size;\n    int64_t total_error = 0;\n    uint8_t vq_pict_buf[(MB_AREA * 3) / 2];\n    uint8_t     *sub_data[4],     *vq_data[4];\n    int      sub_linesize[4],  vq_linesize[4];\n    for (mbn = i = y = 0; y < h; y += MB_SIZE) {\n        for (x = 0; x < s->w; x += MB_SIZE, ++mbn) {\n            int *base;\n            if (CERTAIN(encoding)) {\n                if (s->mb[mbn].best_encoding != encoding)\n                    continue;\n            }\n            base = s->codebook_input + i * entry_size;\n            if (v1mode) {\n                for (j = y2 = 0; y2 < entry_size; y2 += 2)\n                    for (x2 = 0; x2 < 4; x2 += 2, j++) {\n                        plane   = y2 < 4 ? 0 : 1 + (x2 >> 1);\n                        shift   = y2 < 4 ? 0 : 1;\n                        x3      = shift ? 0 : x2;\n                        y3      = shift ? 0 : y2;\n                        base[j] = (data[plane][((x + x3) >> shift) +      ((y + y3) >> shift)      * linesize[plane]] +\n                                   data[plane][((x + x3) >> shift) + 1 +  ((y + y3) >> shift)      * linesize[plane]] +\n                                   data[plane][((x + x3) >> shift) +     (((y + y3) >> shift) + 1) * linesize[plane]] +\n                                   data[plane][((x + x3) >> shift) + 1 + (((y + y3) >> shift) + 1) * linesize[plane]]) >> 2;\n                    }\n            } else {\n                for (j = y2 = 0; y2 < MB_SIZE; y2 += 2) {\n                    for (x2 = 0; x2 < MB_SIZE; x2 += 2)\n                        for (k = 0; k < entry_size; k++, j++) {\n                            plane = k >= 4 ? k - 3 : 0;\n                            if (k >= 4) {\n                                x3 = (x + x2) >> 1;\n                                y3 = (y + y2) >> 1;\n                            } else {\n                                x3 = x + x2 + (k & 1);\n                                y3 = y + y2 + (k >> 1);\n                            }\n                            base[j] = data[plane][x3 + y3 * linesize[plane]];\n                        }\n                }\n            }\n            i += v1mode ? 1 : 4;\n        }\n    }\n    if (i == 0)\n        return 0;\n    if (i < size)\n        size = i;\n    ff_init_elbg(s->codebook_input, entry_size, i, codebook, size, 1, s->codebook_closest, &s->randctx);\n    ff_do_elbg(s->codebook_input, entry_size, i, codebook, size, 1, s->codebook_closest, &s->randctx);\n    vq_data[0]     = vq_pict_buf;\n    vq_linesize[0] = MB_SIZE;\n    vq_data[1]     = &vq_pict_buf[MB_AREA];\n    vq_data[2]     = vq_data[1] + (MB_AREA >> 2);\n    vq_linesize[1] =\n    vq_linesize[2] = MB_SIZE >> 1;\n    for (i = j = y = 0; y < h; y += MB_SIZE)\n        for (x = 0; x < s->w; x += MB_SIZE, j++) {\n            mb_info *mb = &s->mb[j];\n            if (CERTAIN(encoding) && mb->best_encoding != encoding)\n                continue;\n            get_sub_picture(s, x, y, data, linesize, sub_data, sub_linesize);\n            if (v1mode) {\n                mb->v1_vector = s->codebook_closest[i];\n                decode_v1_vector(s, vq_data, vq_linesize, mb->v1_vector, info);\n                mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize,\n                                                     vq_data, vq_linesize);\n                total_error += mb->v1_error;\n            } else {\n                for (k = 0; k < 4; k++)\n                    mb->v4_vector[k] = s->codebook_closest[i + k];\n                decode_v4_vector(s, vq_data, vq_linesize, mb->v4_vector, info);\n                mb->v4_error = compute_mb_distortion(s, sub_data, sub_linesize,\n                                                     vq_data, vq_linesize);\n                total_error += mb->v4_error;\n            }\n            i += v1mode ? 1 : 4;\n        }\n    av_assert0(i >= size);\n    return size;\n}', 'static void decode_v1_vector(CinepakEncContext *s, uint8_t *data[4],\n                             int linesize[4], int v1_vector, strip_info *info)\n{\n    int entry_size = s->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4;\n    data[0][0] =\n    data[0][1] =\n    data[0][    linesize[0]] =\n    data[0][1 + linesize[0]] = info->v1_codebook[v1_vector * entry_size];\n    data[0][2] =\n    data[0][3] =\n    data[0][2 + linesize[0]] =\n    data[0][3 + linesize[0]] = info->v1_codebook[v1_vector * entry_size + 1];\n    data[0][    2 * linesize[0]] =\n    data[0][1 + 2 * linesize[0]] =\n    data[0][    3 * linesize[0]] =\n    data[0][1 + 3 * linesize[0]] = info->v1_codebook[v1_vector * entry_size + 2];\n    data[0][2 + 2 * linesize[0]] =\n    data[0][3 + 2 * linesize[0]] =\n    data[0][2 + 3 * linesize[0]] =\n    data[0][3 + 3 * linesize[0]] = info->v1_codebook[v1_vector * entry_size + 3];\n    if (s->pix_fmt == AV_PIX_FMT_RGB24) {\n        data[1][0] =\n        data[1][1] =\n        data[1][    linesize[1]] =\n        data[1][1 + linesize[1]] = info->v1_codebook[v1_vector * entry_size + 4];\n        data[2][0] =\n        data[2][1] =\n        data[2][    linesize[2]] =\n        data[2][1 + linesize[2]] = info->v1_codebook[v1_vector * entry_size + 5];\n    }\n}']