libavcodec/cinepakenc.c:669: error: Buffer Overrun L3
  Offset: [-1, +oo] (⇐ [-1, +oo] + [0, +oo]) Size: 5 by call to `encode_mode`.

libavcodec/cinepakenc.c:651:26: Assignment
649.         quantize(s, h, pict, 1, v1_size, -1, &info);
650. 
651.         for(v4_size = 0, v4 = -1; v4_size <= v1_size; v4_size = v4_size ? v4_size << 2 : v1_size >= 4 ? v1_size >> 2 : 1, v4++) {
                              ^
652.             //try all modes
653.             for(CinepakMode mode = 0; mode < MODE_COUNT; mode++) {

libavcodec/cinepakenc.c:669:33: Call
667.                 if(best_size == 0 || score < *best_score) {
668.                     *best_score = score;
669.                     best_size = encode_mode(s, mode, h, v1_size, v4_size, v4, scratch_pict, &info, s->strip_buf + STRIP_HEADER_SIZE);
                                     ^
670.                     best_mode = mode;
671. 

libavcodec/cinepakenc.c:349:1: Parameter `v4`
  347. }
  348. 
  349. static int encode_mode(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, AVPicture *scratch_pict, strip_info *info, unsigned char *buf)
       ^
  350. {
  351.     int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA;

libavcodec/cinepakenc.c:377:17: Call
  375.                 decode_v1_vector(s, &sub_scratch, mb, info);
  376.             else if(mode != MODE_V1_ONLY && mb->best_encoding == ENC_V4)
  377.                 decode_v4_vector(s, &sub_scratch, mb->v4_vector[v4], info);
                       ^
  378.         }
  379.     }

libavcodec/cinepakenc.c:335:35: <Offset trace>
333. 
334.     for(i = y = 0; y < 4; y += 2) {
335.         for(x = 0; x < 4; x += 2, i++) {
                                       ^
336.             sub_pict->data[0][x   +     y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size];
337.             sub_pict->data[0][x+1 +     y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size+1];

libavcodec/cinepakenc.c:335:35: Assignment
    333. 
    334.     for(i = y = 0; y < 4; y += 2) {
    335.         for(x = 0; x < 4; x += 2, i++) {
                                           ^
    336.             sub_pict->data[0][x   +     y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size];
    337.             sub_pict->data[0][x+1 +     y*sub_pict->linesize[0]] = info->v4_codebook[v4_vector[i]*entry_size+1];

libavcodec/cinepakenc.c:330:1: <Length trace>
328. 
329. //decodes the V4 vectors in mb into the 4x4 MB pointed to by sub_pict
330. static void decode_v4_vector(CinepakEncContext *s, AVPicture *sub_pict, int *v4_vector, strip_info *info)
     ^
331. {
332.     int i, x, y, entry_size = s->pix_fmt == AV_PIX_FMT_YUV420P ? 6 : 4;

libavcodec/cinepakenc.c:330:1: Parameter `*v4_vector`
    328. 
    329. //decodes the V4 vectors in mb into the 4x4 MB pointed to by sub_pict
    330. static void decode_v4_vector(CinepakEncContext *s, AVPicture *sub_pict, int *v4_vector, strip_info *info)
         ^
    331. {
    332.     int i, x, y, entry_size = s->pix_fmt == AV_PIX_FMT_YUV420P ? 6 : 4;

libavcodec/cinepakenc.c:342:94: Array access: Offset: [-1, +oo] (⇐ [-1, +oo] + [0, +oo]) Size: 5 by call to `encode_mode` 
    340. 
    341.             if(s->pix_fmt == AV_PIX_FMT_YUV420P) {
    342.                 sub_pict->data[1][(x>>1) + (y>>1)*sub_pict->linesize[1]] = info->v4_codebook[v4_vector[i]*entry_size+4];
                                                                                                      ^
    343.                 sub_pict->data[2][(x>>1) + (y>>1)*sub_pict->linesize[2]] = info->v4_codebook[v4_vector[i]*entry_size+5];
    344.             }
