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

libavcodec/motion_est.c:1627:15: Call
1625. 
1626.     if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
1627.         dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
                    ^
1628. 
1629.     get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed

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

libavcodec/motion_est_template.c:185:8: Call
  183. //    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
  184. 
  185.     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);
              ^
  186.     //FIXME check cbp before adding penalty for (0,0) vector
  187.     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_get_mb_score` 
        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);
