libavcodec/motion_est.c:365: error: Buffer Overrun L1
  Offset: 3 Size: 2.

libavcodec/motion_est.c:296:1: <Length trace>
294. }
295. 
296. int ff_init_me(MpegEncContext *s){
     ^
297.     MotionEstContext * const c= &s->me;
298.     int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);

libavcodec/motion_est.c:296:1: Parameter `s->dsp.put_no_rnd_pixels_tab[*]`
294. }
295. 
296. int ff_init_me(MpegEncContext *s){
     ^
297.     MotionEstContext * const c= &s->me;
298.     int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);

libavcodec/motion_est.c:365:24: Array access: Offset: 3 Size: 2
363.     }
364.     c->hpel_put[2][0]= c->hpel_put[2][1]=
365.     c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
                            ^
366. 
367.     if(s->codec_id == AV_CODEC_ID_H261){

int ff_init_me(MpegEncContext *s){
    MotionEstContext * const c= &s->me;
    int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
    int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);
    if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){
        av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n");
        return -1;
    }
    if (s->me_method != ME_ZERO &&
        s->me_method != ME_EPZS &&
        s->me_method != ME_X1) {
        av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size\n");
        return -1;
    }
    c->avctx= s->avctx;
    if(cache_size < 2*dia_size && !c->stride){
        av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n");
    }
    ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);
    ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);
    ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, c->avctx->me_sub_cmp);
    ff_set_cmp(&s->dsp, s->dsp.mb_cmp, c->avctx->mb_cmp);
    c->flags    = get_flags(c, 0, c->avctx->me_cmp    &FF_CMP_CHROMA);
    c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA);
    c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp    &FF_CMP_CHROMA);
    if(s->flags&CODEC_FLAG_QPEL){
        c->sub_motion_search= qpel_motion_search;
        c->qpel_avg= s->dsp.avg_qpel_pixels_tab;
        if(s->no_rounding) c->qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;
        else               c->qpel_put= s->dsp.put_qpel_pixels_tab;
    }else{
        if(c->avctx->me_sub_cmp&FF_CMP_CHROMA)
            c->sub_motion_search= hpel_motion_search;
        else if(   c->avctx->me_sub_cmp == FF_CMP_SAD
                && c->avctx->    me_cmp == FF_CMP_SAD
                && c->avctx->    mb_cmp == FF_CMP_SAD)
            c->sub_motion_search= sad_hpel_motion_search;
        else
            c->sub_motion_search= hpel_motion_search;
    }
    c->hpel_avg= s->dsp.avg_pixels_tab;
    if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab;
    else               c->hpel_put= s->dsp.put_pixels_tab;
    if(s->linesize){
        c->stride  = s->linesize;
        c->uvstride= s->uvlinesize;
    }else{
        c->stride  = 16*s->mb_width + 32;
        c->uvstride=  8*s->mb_width + 16;
    }
    if((c->avctx->me_cmp&FF_CMP_CHROMA) ){
        s->dsp.me_cmp[2]= zero_cmp;
    }
    if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
        s->dsp.me_sub_cmp[2]= zero_cmp;
    }
    c->hpel_put[2][0]= c->hpel_put[2][1]=
    c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
    if(s->codec_id == AV_CODEC_ID_H261){
        c->sub_motion_search= no_sub_motion_search;
    }
    return 0;
}
['int ff_init_me(MpegEncContext *s){\n    MotionEstContext * const c= &s->me;\n    int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);\n    int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);\n    if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){\n        av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\\n");\n        return -1;\n    }\n    if (s->me_method != ME_ZERO &&\n        s->me_method != ME_EPZS &&\n        s->me_method != ME_X1) {\n        av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size\\n");\n        return -1;\n    }\n    c->avctx= s->avctx;\n    if(cache_size < 2*dia_size && !c->stride){\n        av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\\n");\n    }\n    ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);\n    ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);\n    ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, c->avctx->me_sub_cmp);\n    ff_set_cmp(&s->dsp, s->dsp.mb_cmp, c->avctx->mb_cmp);\n    c->flags    = get_flags(c, 0, c->avctx->me_cmp    &FF_CMP_CHROMA);\n    c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA);\n    c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp    &FF_CMP_CHROMA);\n    if(s->flags&CODEC_FLAG_QPEL){\n        c->sub_motion_search= qpel_motion_search;\n        c->qpel_avg= s->dsp.avg_qpel_pixels_tab;\n        if(s->no_rounding) c->qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;\n        else               c->qpel_put= s->dsp.put_qpel_pixels_tab;\n    }else{\n        if(c->avctx->me_sub_cmp&FF_CMP_CHROMA)\n            c->sub_motion_search= hpel_motion_search;\n        else if(   c->avctx->me_sub_cmp == FF_CMP_SAD\n                && c->avctx->    me_cmp == FF_CMP_SAD\n                && c->avctx->    mb_cmp == FF_CMP_SAD)\n            c->sub_motion_search= sad_hpel_motion_search;\n        else\n            c->sub_motion_search= hpel_motion_search;\n    }\n    c->hpel_avg= s->dsp.avg_pixels_tab;\n    if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab;\n    else               c->hpel_put= s->dsp.put_pixels_tab;\n    if(s->linesize){\n        c->stride  = s->linesize;\n        c->uvstride= s->uvlinesize;\n    }else{\n        c->stride  = 16*s->mb_width + 32;\n        c->uvstride=  8*s->mb_width + 16;\n    }\n    if((c->avctx->me_cmp&FF_CMP_CHROMA) ){\n        s->dsp.me_cmp[2]= zero_cmp;\n    }\n    if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){\n        s->dsp.me_sub_cmp[2]= zero_cmp;\n    }\n    c->hpel_put[2][0]= c->hpel_put[2][1]=\n    c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;\n    if(s->codec_id == AV_CODEC_ID_H261){\n        c->sub_motion_search= no_sub_motion_search;\n    }\n    return 0;\n}']