libavcodec/motion_est.c:1129: error: Buffer Overrun L2
  Offset: [2, 5] (⇐ [0, 3] + 2) Size: 4 by call to `cmp`.

libavcodec/motion_est.c:1125:13: Assignment
1123.         chroma_cmpf= s->dsp.sse[1];
1124.         init_mv4_ref(c);
1125.         for(i=0; i<4; i++){
                  ^
1126.             xy= s->block_index[i];
1127.             x= p->motion_val[0][xy][0];

libavcodec/motion_est.c:1129:17: Call
1127.             x= p->motion_val[0][xy][0];
1128.             y= p->motion_val[0][xy][1];
1129.             d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 1, 8, i, i, cmpf, chroma_cmpf, flags);
                      ^
1130.         }
1131.         s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER4V;

libavcodec/motion_est.c:108:1: <Length trace>
106.     against a proposed motion-compensated prediction of that block
107.  */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
     ^
109.                       const int size, const int h, int ref_index, int src_index,
110.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){

libavcodec/motion_est.c:108:1: Parameter `ref_index`
  106.     against a proposed motion-compensated prediction of that block
  107.  */
  108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
       ^
  109.                       const int size, const int h, int ref_index, int src_index,
  110.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){

libavcodec/motion_est.c:119:5: Assignment
  117.     const int hx= subx + (x<<(1+qpel));
  118.     const int hy= suby + (y<<(1+qpel));
  119.     uint8_t * const * const ref= c->ref[ref_index];
           ^
  120.     uint8_t * const * const src= c->src[src_index];
  121.     int d;

libavcodec/motion_est.c:209:50: Array access: Offset: [2, 5] (⇐ [0, 3] + 2) Size: 4 by call to `cmp` 
  207.             uint8_t * const uvtemp= c->temp + 16*stride;
  208.             c->hpel_put[size+1][uvdxy](uvtemp  , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
  209.             c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
                                                        ^
  210.             d += chroma_cmp_func(s, uvtemp  , src[1], uvstride, h>>1);
  211.             d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
