libavcodec/cinepakenc.c:663: error: Buffer Overrun L3
  Offset: [-1, +oo] Size: 5 by call to `calculate_mode_score`.

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:663:25: Call
661. 
662.                 info.v4_codebook = v4 >= 0 ? v4_codebooks[v4] : NULL;
663.                 score = calculate_mode_score(s, mode, h, v1_size, v4_size, v4, &info);
                             ^
664. 
665.                 //av_log(s->avctx, AV_LOG_INFO, "%3i %3i score = %li\n", v1_size, v4_size, score);

libavcodec/cinepakenc.c:186:1: <Offset trace>
184. }
185. 
186. static int64_t calculate_mode_score(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, strip_info *info)
     ^
187. {
188.     //score = FF_LAMBDA_SCALE * error + lambda * bits

libavcodec/cinepakenc.c:186:1: Parameter `v4`
  184. }
  185. 
  186. static int64_t calculate_mode_score(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, strip_info *info)
       ^
  187. {
  188.     //score = FF_LAMBDA_SCALE * error + lambda * bits

libavcodec/cinepakenc.c:186:1: <Length trace>
184. }
185. 
186. static int64_t calculate_mode_score(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, strip_info *info)
     ^
187. {
188.     //score = FF_LAMBDA_SCALE * error + lambda * bits

libavcodec/cinepakenc.c:186:1: Parameter `s->mb->v4_error[*]`
  184. }
  185. 
  186. static int64_t calculate_mode_score(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, strip_info *info)
       ^
  187. {
  188.     //score = FF_LAMBDA_SCALE * error + lambda * bits

libavcodec/cinepakenc.c:217:57: Array access: Offset: [-1, +oo] Size: 5 by call to `calculate_mode_score` 
  215.             mb = &s->mb[x];
  216.             score1 = s->lambda * 9  + FF_LAMBDA_SCALE * mb->v1_error;
  217.             score2 = s->lambda * 33 + FF_LAMBDA_SCALE * mb->v4_error[v4];
                                                               ^
  218. 
  219.             if(score1 <= score2) {
