libavcodec/motion_est.c:1515: error: Buffer Overrun L1
  Offset: 10 (⇐ 2 + 8) Size: 4 by call to `estimate_motion_b`.

libavcodec/motion_est.c:1515:12: Call
1513. 
1514.     c->skip=0;
1515.     bmin = estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) +
                 ^
1516.            2 * penalty_factor;
1517.     ff_dlog(s, " %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);

libavcodec/motion_est.c:1103:1: Parameter `ref_index`
  1101. }
  1102. 
  1103. static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
        ^
  1104.                              int16_t (*mv_table)[2], int ref_index, int f_code)
  1105. {

libavcodec/motion_est.c:1150:16: Call
  1148.         }
  1149. 
  1150.         dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
                       ^
  1151.     }
  1152. 

libavcodec/motion_est_template.c:977:1: Parameter `ref_index`
    975. 
    976. //this function is dedicated to the braindamaged gcc
    977. int ff_epzs_motion_search(MpegEncContext *s, int *mx_ptr, int *my_ptr,
         ^
    978.                           int P[10][2], int src_index, int ref_index,
    979.                           int16_t (*last_mv)[2], int ref_mv_scale,

libavcodec/motion_est_template.c:985:16: Call
    983. //FIXME convert other functions in the same way if faster
    984.     if(c->flags==0 && h==16 && size==0){
    985.         return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16);
                        ^
    986. //    case FLAG_QPEL:
    987. //        return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, FLAG_QPEL);

libavcodec/motion_est_template.c:860:1: Parameter `ref_index`
      858.    optimal mv.
      859.  */
      860. static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
           ^
      861.                              int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
      862.                              int ref_mv_scale, int flags, int size, int h)

libavcodec/motion_est_template.c:967:11: Call
      965. 
      966. //check(best[0],best[1],0, b0)
      967.     dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                     ^
      968. 
      969. //check(best[0],best[1],0, b1)

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:845:26: Call
        843.         return          full_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
        844.     else if(c->dia_size>768)
        845.         return           umh_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
                                      ^
        846.     else if(c->dia_size>512)
        847.         return           hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, c->dia_size&0xFF);

libavcodec/motion_est_template.c:573:1: Parameter `ref_index`
          571. }
          572. 
          573. static int umh_search(MpegEncContext * s, int *best, int dmin,
               ^
          574.                                        int src_index, int ref_index, const int penalty_factor,
          575.                                        int size, int h, int flags)

libavcodec/motion_est_template.c:595:9: Call
          593.     y= best[1];
          594.     for(x2=FFMAX(x-dia_size+1, xmin); x2<=FFMIN(x+dia_size-1,xmax); x2+=2){
          595.         CHECK_MV(x2, y);
                       ^
          596.     }
          597.     for(y2=FFMAX(y-dia_size/2+1, ymin); y2<=FFMIN(y+dia_size/2-1,ymax); y2+=2){

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:266:16: Call
            264.     }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
            265.        && subx==0 && suby==0){
            266.         return cmp_fpel_internal(s,x,y,size,h,ref_index,src_index, cmp_func, chroma_cmp_func,flags);
                                ^
            267.     }else{
            268.         return cmp_internal(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags);

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

libavcodec/motion_est.c:238:16: Call
              236.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
              237.     if(flags&FLAG_DIRECT){
              238.         return cmp_direct_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL);
                                  ^
              239.     }else{
              240.         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:110:1: <Length trace>
108. }
109. 
110. static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
     ^
111.                       const int size, const int h, int ref_index, int src_index,
112.                       me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){

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

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

libavcodec/motion_est.c:173:50: Array access: Offset: 10 (⇐ 2 + 8) Size: 4 by call to `estimate_motion_b` 
                171. 
                172.                     c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
                173.                     c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
                                                                      ^
                174.                 }
                175.             }
