libavcodec/motion_est.c:981: error: Buffer Overrun L1
  Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `cmp`.

libavcodec/motion_est.c:977:13: Assignment
975.         chroma_cmpf= s->dsp.sse[1];
976.         init_mv4_ref(c);
977.         for(i=0; i<4; i++){
                 ^
978.             xy= s->block_index[i];
979.             x= p->f.motion_val[0][xy][0];

libavcodec/motion_est.c:981:17: Call
979.             x= p->f.motion_val[0][xy][0];
980.             y= p->f.motion_val[0][xy][1];
981.             d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 1, 8, i, i, cmpf, chroma_cmpf, flags);
                     ^
982.         }
983.         s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER4V;

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

libavcodec/motion_est.c:263:16: Call
  261.     }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
  262.        && subx==0 && suby==0){
  263.         return cmp_fpel_internal(s,x,y,size,h,ref_index,src_index, cmp_func, chroma_cmp_func,flags);
                      ^
  264.     }else{
  265.         return cmp_internal(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags);

libavcodec/motion_est.c:231:1: Parameter `ref_index`
    229. }
    230. 
    231. static int cmp_fpel_internal(MpegEncContext *s, const int x, const int y,
         ^
    232.                       const int size, const int h, int ref_index, int src_index,
    233.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){

libavcodec/motion_est.c:235:16: Call
    233.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
    234.     if(flags&FLAG_DIRECT){
    235.         return cmp_direct_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL);
                        ^
    236.     }else{
    237.         return cmp_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 0, flags&FLAG_CHROMA);

libavcodec/motion_est.c:107:1: <Length trace>
105. }
106. 
107. static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
     ^
108.                       const int size, const int h, int ref_index, int src_index,
109.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){

libavcodec/motion_est.c:107:1: Parameter `ref_index`
      105. }
      106. 
      107. static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
           ^
      108.                       const int size, const int h, int ref_index, int src_index,
      109.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){

libavcodec/motion_est.c:114:5: Assignment
      112.     const int hx= subx + (x<<(1+qpel));
      113.     const int hy= suby + (y<<(1+qpel));
      114.     uint8_t * const * const ref= c->ref[ref_index];
               ^
      115.     uint8_t * const * const src= c->src[src_index];
      116.     int d;

libavcodec/motion_est.c:136:50: Array access: Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `cmp` 
      134.                     if(qpel){
      135.                         c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
      136.                         c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
                                                            ^
      137.                     }else{
      138.                         c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
