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

libavcodec/motion_est.c:758:9: Assignment
756.     init_mv4_ref(c);
757. 
758.     for(block=0; block<4; block++){
             ^
759.         int mx4, my4;
760.         int pred_x4, pred_y4;

libavcodec/motion_est.c:794:17: Call
792.         P_MV1[1]= my;
793. 
794.         dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
                     ^
795. 
796.         dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);

libavcodec/motion_est_template.c:1131:1: Parameter `ref_index`
  1129. }
  1130. 
  1131. static int epzs_motion_search4(MpegEncContext * s,
        ^
  1132.                              int *mx_ptr, int *my_ptr, int P[10][2],
  1133.                              int src_index, int ref_index, int16_t (*last_mv)[2],

libavcodec/motion_est_template.c:1181:11: Call
  1179.     }
  1180. 
  1181.     dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                  ^
  1182. 
  1183.     *mx_ptr= best[0];

libavcodec/motion_est_template.c:973:1: Parameter `ref_index`
    971. }
    972. 
    973. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
         ^
    974.                                        int src_index, int ref_index, int const penalty_factor,
    975.                                        int size, int h, int flags){

libavcodec/motion_est_template.c:990:18: Call
    988.         return       l2s_dia_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
    989.     else
    990.         return   var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                          ^
    991. }
    992. 

libavcodec/motion_est_template.c:896:1: Parameter `ref_index`
      894. }
      895. 
      896. static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
           ^
      897.                                        int src_index, int ref_index, int const penalty_factor,
      898.                                        int size, int h, int flags)

libavcodec/motion_est_template.c:921:13: Call
      919. 
      920. //check(x + dir,y + dia_size - dir,0, a0)
      921.             CHECK_MV(x + dir           , y + dia_size - dir);
                       ^
      922.         }
      923. 

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 `epzs_motion_search4` 
        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);
