libavcodec/motion_est.c:1807: error: Buffer Overrun L2
  Offset: [3, 4] (⇐ [2, 3] + 1) Size: 4 by call to `interlaced_search`.

libavcodec/motion_est.c:1807:16: Call
1805.                                  s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0);
1806.         c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
1807.         bimin= interlaced_search(s, 2,
                     ^
1808.                                  s->b_field_mv_table[1], s->b_field_select_table[1],
1809.                                  s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0);

libavcodec/motion_est.c:745:1: Parameter `ref_index`
  743. }
  744. 
  745. static int interlaced_search(MpegEncContext *s, int ref_index,
       ^
  746.                              int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select)
  747. {

libavcodec/motion_est.c:805:20: Call
  803.             P_MV1[1]= my / 2;
  804. 
  805.             dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
                          ^
  806. 
  807.             dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);

libavcodec/motion_est_template.c:1226:1: Parameter `ref_index`
    1224. 
    1225. //try to merge with above FIXME (needs PSNR test)
    1226. static int epzs_motion_search2(MpegEncContext * s,
          ^
    1227.                              int *mx_ptr, int *my_ptr, int P[10][2],
    1228.                              int src_index, int ref_index, int16_t (*last_mv)[2],

libavcodec/motion_est_template.c:1276:11: Call
    1274.     }
    1275. 
    1276.     dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                    ^
    1277. 
    1278.     *mx_ptr= best[0];

libavcodec/motion_est_template.c:1006:1: Parameter `ref_index`
      1004. }
      1005. 
      1006. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
            ^
      1007.                                        int src_index, int ref_index, int const penalty_factor,
      1008.                                        int size, int h, int flags){

libavcodec/motion_est_template.c:1017:25: Call
      1015.         return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
      1016.     else if(c->dia_size>1024)
      1017.         return          full_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                                    ^
      1018.     else if(c->dia_size>768)
      1019.         return           umh_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);

libavcodec/motion_est_template.c:777:1: Parameter `ref_index`
        775. }
        776. 
        777. static int full_search(MpegEncContext * s, int *best, int dmin,
             ^
        778.                                        int src_index, int ref_index, int const penalty_factor,
        779.                                        int size, int h, int flags)

libavcodec/motion_est_template.c:801:5: Call
        799.     y= best[1];
        800.     d= dmin;
        801.     CHECK_CLIPPED_MV(x  , y);
                 ^
        802.     CHECK_CLIPPED_MV(x+1, y);
        803.     CHECK_CLIPPED_MV(x, y+1);

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:260:16: Call
          258.        && av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
          259.        && flags==0 && h==16 && size==0 && subx==0 && suby==0){
          260.         return cmp_simple(s,x,y,ref_index,src_index, cmp_func, chroma_cmp_func);
                              ^
          261.     }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
          262.        && subx==0 && suby==0){

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

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

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

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

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

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