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

libavcodec/motion_est.c:1762:17: Call
1760.             if(type == CANDIDATE_MB_TYPE_BACKWARD || type == CANDIDATE_MB_TYPE_BIDIR){
1761.                 c->skip=0;
1762.                 ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code);
                      ^
1763.             }
1764.             if(type == CANDIDATE_MB_TYPE_FORWARD_I || type == CANDIDATE_MB_TYPE_BIDIR_I){

libavcodec/motion_est.c:1316:1: Parameter `ref_index`
  1314. }
  1315. 
  1316. static int ff_estimate_motion_b(MpegEncContext * s,
        ^
  1317.                        int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code)
  1318. {

libavcodec/motion_est.c:1374:16: Call
  1372.         }
  1373. 
  1374.         dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
                       ^
  1375. 
  1376.         break;

libavcodec/motion_est_template.c:1153:1: Parameter `ref_index`
    1151. 
    1152. //this function is dedicated to the braindamaged gcc
    1153. inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
          ^
    1154.                              int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
    1155.                              int ref_mv_scale, int size, int h)

libavcodec/motion_est_template.c:1160:16: Call
    1158. //FIXME convert other functions in the same way if faster
    1159.     if(c->flags==0 && h==16 && size==0){
    1160.         return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16);
                         ^
    1161. //    case FLAG_QPEL:
    1162. //        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:1036:1: Parameter `ref_index`
      1034.    optimal mv.
      1035.  */
      1036. static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
            ^
      1037.                              int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
      1038.                              int ref_mv_scale, int flags, int size, int h)

libavcodec/motion_est_template.c:1081:9: Call
      1079.     if (s->first_slice_line) {
      1080.         CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
      1081.         CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
                    ^
      1082.                         (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
      1083.     }else{

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

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

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

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

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

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