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

libavcodec/motion_est.c:573:9: Assignment
571.     init_mv4_ref(c);
572. 
573.     for(block=0; block<4; block++){
             ^
574.         int mx4, my4;
575.         int pred_x4, pred_y4;

libavcodec/motion_est.c:609:17: Call
607.         P_MV1[1]= my;
608. 
609.         dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
                     ^
610. 
611.         dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);

libavcodec/motion_est_template.c:990:1: Parameter `ref_index`
  988. }
  989. 
  990. static int epzs_motion_search4(MpegEncContext * s,
       ^
  991.                              int *mx_ptr, int *my_ptr, int P[10][2],
  992.                              int src_index, int ref_index, int16_t (*last_mv)[2],

libavcodec/motion_est_template.c:1040:11: Call
  1038.     }
  1039. 
  1040.     dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                  ^
  1041. 
  1042.     *mx_ptr= best[0];

libavcodec/motion_est_template.c:830:1: Parameter `ref_index`
    828. }
    829. 
    830. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
         ^
    831.                                        int src_index, int ref_index, int const penalty_factor,
    832.                                        int size, int h, int flags){

libavcodec/motion_est_template.c:847:22: Call
    845.         return           hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, c->dia_size&0xFF);
    846.     else if(c->dia_size>256)
    847.         return       l2s_dia_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                              ^
    848.     else
    849.         return   var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);

libavcodec/motion_est_template.c:534:1: Parameter `ref_index`
      532. }
      533. 
      534. static int l2s_dia_search(MpegEncContext * s, int *best, int dmin,
           ^
      535.                                        int src_index, int ref_index, int const penalty_factor,
      536.                                        int size, int h, int flags)

libavcodec/motion_est_template.c:557:17: Call
      555.             y= best[1];
      556.             for(i=0; i<8; i++){
      557.                 CHECK_CLIPPED_MV(x+hex[i][0]*dia_size, y+hex[i][1]*dia_size);
                           ^
      558.             }
      559.         }while(best[0] != x || best[1] != y);

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

libavcodec/motion_est.c:257:16: Call
        255.        && av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
        256.        && flags==0 && h==16 && size==0 && subx==0 && suby==0){
        257.         return cmp_simple(s,x,y,ref_index,src_index, cmp_func, chroma_cmp_func);
                            ^
        258.     }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
        259.        && subx==0 && suby==0){

libavcodec/motion_est.c:222:1: Parameter `ref_index`
          220. }
          221. 
          222. static int cmp_simple(MpegEncContext *s, const int x, const int y,
               ^
          223.                       int ref_index, int src_index,
          224.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func){

libavcodec/motion_est.c:225:12: Call
          223.                       int ref_index, int src_index,
          224.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func){
          225.     return cmp_inline(s,x,y,0,0,0,16,ref_index,src_index, cmp_func, chroma_cmp_func, 0, 0);
                          ^
          226. }
          227. 

libavcodec/motion_est.c:176:1: <Length trace>
174. }
175. 
176. static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
     ^
177.                       const int size, const int h, int ref_index, int src_index,
178.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel, int chroma){

libavcodec/motion_est.c:176:1: Parameter `ref_index`
            174. }
            175. 
            176. static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
                 ^
            177.                       const int size, const int h, int ref_index, int src_index,
            178.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel, int chroma){

libavcodec/motion_est.c:185:5: Assignment
            183.     const int hx= subx + (x<<(1+qpel));
            184.     const int hy= suby + (y<<(1+qpel));
            185.     uint8_t * const * const ref= c->ref[ref_index];
                     ^
            186.     uint8_t * const * const src= c->src[src_index];
            187.     int d;

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