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

libavcodec/motion_est.c:594:9: Assignment
592.     init_mv4_ref(c);
593. 
594.     for(block=0; block<4; block++){
             ^
595.         int mx4, my4;
596.         int pred_x4, pred_y4;

libavcodec/motion_est.c:630:17: Call
628.         P_MV1[1]= my;
629. 
630.         dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
                     ^
631. 
632.         dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);

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

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

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

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

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

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

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

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

libavcodec/motion_est.c:228:1: Parameter `ref_index`
          226. }
          227. 
          228. static int cmp_simple(MpegEncContext *s, const int x, const int y,
               ^
          229.                       int ref_index, int src_index,
          230.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func){

libavcodec/motion_est.c:231:12: Call
          229.                       int ref_index, int src_index,
          230.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func){
          231.     return cmp_inline(s,x,y,0,0,0,16,ref_index,src_index, cmp_func, chroma_cmp_func, 0, 0);
                          ^
          232. }
          233. 

libavcodec/motion_est.c:182:1: <Length trace>
180. }
181. 
182. static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
     ^
183.                       const int size, const int h, int ref_index, int src_index,
184.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel, int chroma){

libavcodec/motion_est.c:182:1: Parameter `ref_index`
            180. }
            181. 
            182. static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
                 ^
            183.                       const int size, const int h, int ref_index, int src_index,
            184.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel, int chroma){

libavcodec/motion_est.c:191:5: Assignment
            189.     const int hx= subx + (x<<(1+qpel));
            190.     const int hy= suby + (y<<(1+qpel));
            191.     uint8_t * const * const ref= c->ref[ref_index];
                     ^
            192.     uint8_t * const * const src= c->src[src_index];
            193.     int d;

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