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

libavcodec/motion_est.c:1525:12: Call
1523. //FIXME penalty stuff for non mpeg4
1524.     c->skip=0;
1525.     fmin = estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) +
                 ^
1526.            3 * penalty_factor;
1527. 

libavcodec/motion_est.c:1107:1: Parameter `ref_index`
  1105. }
  1106. 
  1107. static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
        ^
  1108.                              int16_t (*mv_table)[2], int ref_index, int f_code)
  1109. {

libavcodec/motion_est.c:1162:16: Call
  1160.         }
  1161. 
  1162.         dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
                       ^
  1163. 
  1164.         break;

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

libavcodec/motion_est_template.c:982:16: Call
    980. //FIXME convert other functions in the same way if faster
    981.     if(c->flags==0 && h==16 && size==0){
    982.         return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16);
                        ^
    983. //    case FLAG_QPEL:
    984. //        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:858:1: Parameter `ref_index`
      856.    optimal mv.
      857.  */
      858. static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
           ^
      859.                              int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
      860.                              int ref_mv_scale, int flags, int size, int h)

libavcodec/motion_est_template.c:892:11: Call
      890. 
      891.     assert(cmpf);
      892.     dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
                     ^
      893.     map[0]= map_generation;
      894.     score_map[0]= dmin;

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

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

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

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

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

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

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