libavcodec/motion_est.c:1689: error: Buffer Overrun L1
  Offset: 8 Size: 4 by call to `ff_estimate_motion_b`.

libavcodec/motion_est.c:1689:17: Call
1687.             if(type == CANDIDATE_MB_TYPE_FORWARD || type == CANDIDATE_MB_TYPE_BIDIR){
1688.                 c->skip=0;
1689.                 ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code);
                      ^
1690.             }
1691.             if(type == CANDIDATE_MB_TYPE_BACKWARD || type == CANDIDATE_MB_TYPE_BIDIR){

libavcodec/motion_est.c:1250:1: Parameter `ref_index`
  1248. }
  1249. 
  1250. static int ff_estimate_motion_b(MpegEncContext * s,
        ^
  1251.                        int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code)
  1252. {

libavcodec/motion_est.c:1313:15: Call
  1311. 
  1312.     if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
  1313.         dmin= get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
                      ^
  1314. 
  1315. //    s->mb_type[mb_y*s->mb_width + mb_x]= mb_type;

libavcodec/motion_est_template.c:163:1: Parameter `ref_index`
    161. }
    162. 
    163. static inline int get_mb_score(MpegEncContext *s, int mx, int my,
         ^
    164.                                int src_index, int ref_index, int size,
    165.                                int h, int add_rate)

libavcodec/motion_est_template.c:186:8: Call
    184. //    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
    185. 
    186.     d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
                ^
    187.     //FIXME check cbp before adding penalty for (0,0) vector
    188.     if(add_rate && (mx || my || size>0))

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

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

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

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

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

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

libavcodec/motion_est.c:134:50: Array access: Offset: 8 Size: 4 by call to `ff_estimate_motion_b` 
          132.                     if(qpel){
          133.                         c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
          134.                         c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
                                                                ^
          135.                     }else{
          136.                         c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
