libavcodec/cavs.c:421: error: Buffer Overrun L2
  Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std`.

libavcodec/cavs.c:413:1: Parameter `h->s.dsp.put_cavs_qpel_pixels_tab[*]`
411. }
412. 
413. void ff_cavs_inter(AVSContext *h, enum mb_t mb_type) {
     ^
414.     if(ff_cavs_partition_flags[mb_type] == 0){ // 16x16
415.         mc_part_std(h, 1, 8, 0, h->cy, h->cu, h->cv, 0, 0,

libavcodec/cavs.c:421:9: Call
419.                 h->s.dsp.avg_h264_chroma_pixels_tab[0],&h->mv[MV_FWD_X0]);
420.     }else{
421.         mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 0, 0,
             ^
422.                 h->s.dsp.put_cavs_qpel_pixels_tab[1],
423.                 h->s.dsp.put_h264_chroma_pixels_tab[1],

libavcodec/cavs.c:381:1: Parameter `*qpix_put`
  379. }
  380. 
  381. static inline void mc_part_std(AVSContext *h,int square,int chroma_height,int delta,
       ^
  382.                         uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr,
  383.                         int x_offset, int y_offset,qpel_mc_func *qpix_put,

libavcodec/cavs.c:386:5: Assignment
  384.                         h264_chroma_mc_func chroma_put,qpel_mc_func *qpix_avg,
  385.                         h264_chroma_mc_func chroma_avg, vector_t *mv){
  386.     qpel_mc_func *qpix_op=  qpix_put;
           ^
  387.     h264_chroma_mc_func chroma_op= chroma_put;
  388. 

libavcodec/cavs.c:397:9: Call
  395.     if(mv->ref >= 0){
  396.         Picture *ref= &h->DPB[mv->ref];
  397.         mc_dir_part(h, ref, square, chroma_height, delta, 0,
               ^
  398.                     dest_y, dest_cb, dest_cr, x_offset, y_offset,
  399.                     qpix_op, chroma_op, mv);

libavcodec/cavs.c:326:1: <Offset trace>
324.  ****************************************************************************/
325. 
326. static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
     ^
327.                         int chroma_height,int delta,int list,uint8_t *dest_y,
328.                         uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,

libavcodec/cavs.c:326:1: Parameter `src_x_offset`
    324.  ****************************************************************************/
    325. 
    326. static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
         ^
    327.                         int chroma_height,int delta,int list,uint8_t *dest_y,
    328.                         uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,

libavcodec/cavs.c:332:5: Assignment
    330.                         h264_chroma_mc_func chroma_op,vector_t *mv){
    331.     MpegEncContext * const s = &h->s;
    332.     const int mx= mv->x + src_x_offset*8;
             ^
    333.     const int my= mv->y + src_y_offset*8;
    334.     const int luma_xy= (mx&3) + ((my&3)<<2);

libavcodec/cavs.c:334:5: Assignment
    332.     const int mx= mv->x + src_x_offset*8;
    333.     const int my= mv->y + src_y_offset*8;
    334.     const int luma_xy= (mx&3) + ((my&3)<<2);
             ^
    335.     uint8_t * src_y = pic->data[0] + (mx>>2) + (my>>2)*h->l_stride;
    336.     uint8_t * src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->c_stride;

libavcodec/cavs.c:326:1: <Length trace>
324.  ****************************************************************************/
325. 
326. static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
     ^
327.                         int chroma_height,int delta,int list,uint8_t *dest_y,
328.                         uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,

libavcodec/cavs.c:326:1: Parameter `*qpix_op`
    324.  ****************************************************************************/
    325. 
    326. static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
         ^
    327.                         int chroma_height,int delta,int list,uint8_t *dest_y,
    328.                         uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,

libavcodec/cavs.c:361:5: Array access: Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std` 
    359.     }
    360. 
    361.     qpix_op[luma_xy](dest_y, src_y, h->l_stride); //FIXME try variable height perhaps?
             ^
    362.     if(!square){
    363.         qpix_op[luma_xy](dest_y + delta, src_y + delta, h->l_stride);

static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
                        int chroma_height,int delta,int list,uint8_t *dest_y,
                        uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
                        int src_y_offset,qpel_mc_func *qpix_op,
                        h264_chroma_mc_func chroma_op,vector_t *mv){
    MpegEncContext * const s = &h->s;
    const int mx= mv->x + src_x_offset*8;
    const int my= mv->y + src_y_offset*8;
    const int luma_xy= (mx&3) + ((my&3)<<2);
    uint8_t * src_y = pic->data[0] + (mx>>2) + (my>>2)*h->l_stride;
    uint8_t * src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->c_stride;
    uint8_t * src_cr= pic->data[2] + (mx>>3) + (my>>3)*h->c_stride;
    int extra_width= 0;
    int extra_height= extra_width;
    int emu=0;
    const int full_mx= mx>>2;
    const int full_my= my>>2;
    const int pic_width  = 16*h->mb_width;
    const int pic_height = 16*h->mb_height;
    if(!pic->data[0])
        return;
    if(mx&7) extra_width -= 3;
    if(my&7) extra_height -= 3;
    if(   full_mx < 0-extra_width
          || full_my < 0-extra_height
          || full_mx + 16  > pic_width + extra_width
          || full_my + 16  > pic_height + extra_height){
        ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride,
                            16+5, 16+5 , full_mx-2, full_my-2, pic_width, pic_height);
        src_y= s->edge_emu_buffer + 2 + 2*h->l_stride;
        emu=1;
    }
    qpix_op[luma_xy](dest_y, src_y, h->l_stride);
    if(!square){
        qpix_op[luma_xy](dest_y + delta, src_y + delta, h->l_stride);
    }
    if(emu){
        ff_emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride,
                            9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
        src_cb= s->edge_emu_buffer;
    }
    chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7);
    if(emu){
        ff_emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride,
                            9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
        src_cr= s->edge_emu_buffer;
    }
    chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7);
}
['void ff_cavs_inter(AVSContext *h, enum mb_t mb_type) {\n    if(ff_cavs_partition_flags[mb_type] == 0){\n        mc_part_std(h, 1, 8, 0, h->cy, h->cu, h->cv, 0, 0,\n                h->s.dsp.put_cavs_qpel_pixels_tab[0],\n                h->s.dsp.put_h264_chroma_pixels_tab[0],\n                h->s.dsp.avg_cavs_qpel_pixels_tab[0],\n                h->s.dsp.avg_h264_chroma_pixels_tab[0],&h->mv[MV_FWD_X0]);\n    }else{\n        mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 0, 0,\n                h->s.dsp.put_cavs_qpel_pixels_tab[1],\n                h->s.dsp.put_h264_chroma_pixels_tab[1],\n                h->s.dsp.avg_cavs_qpel_pixels_tab[1],\n                h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X0]);\n        mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 4, 0,\n                h->s.dsp.put_cavs_qpel_pixels_tab[1],\n                h->s.dsp.put_h264_chroma_pixels_tab[1],\n                h->s.dsp.avg_cavs_qpel_pixels_tab[1],\n                h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X1]);\n        mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 0, 4,\n                h->s.dsp.put_cavs_qpel_pixels_tab[1],\n                h->s.dsp.put_h264_chroma_pixels_tab[1],\n                h->s.dsp.avg_cavs_qpel_pixels_tab[1],\n                h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X2]);\n        mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 4, 4,\n                h->s.dsp.put_cavs_qpel_pixels_tab[1],\n                h->s.dsp.put_h264_chroma_pixels_tab[1],\n                h->s.dsp.avg_cavs_qpel_pixels_tab[1],\n                h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X3]);\n    }\n}', 'static inline void mc_part_std(AVSContext *h,int square,int chroma_height,int delta,\n                        uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr,\n                        int x_offset, int y_offset,qpel_mc_func *qpix_put,\n                        h264_chroma_mc_func chroma_put,qpel_mc_func *qpix_avg,\n                        h264_chroma_mc_func chroma_avg, vector_t *mv){\n    qpel_mc_func *qpix_op=  qpix_put;\n    h264_chroma_mc_func chroma_op= chroma_put;\n    dest_y  += 2*x_offset + 2*y_offset*h->l_stride;\n    dest_cb +=   x_offset +   y_offset*h->c_stride;\n    dest_cr +=   x_offset +   y_offset*h->c_stride;\n    x_offset += 8*h->mbx;\n    y_offset += 8*h->mby;\n    if(mv->ref >= 0){\n        Picture *ref= &h->DPB[mv->ref];\n        mc_dir_part(h, ref, square, chroma_height, delta, 0,\n                    dest_y, dest_cb, dest_cr, x_offset, y_offset,\n                    qpix_op, chroma_op, mv);\n        qpix_op=  qpix_avg;\n        chroma_op= chroma_avg;\n    }\n    if((mv+MV_BWD_OFFS)->ref >= 0){\n        Picture *ref= &h->DPB[0];\n        mc_dir_part(h, ref, square, chroma_height, delta, 1,\n                    dest_y, dest_cb, dest_cr, x_offset, y_offset,\n                    qpix_op, chroma_op, mv+MV_BWD_OFFS);\n    }\n}', 'static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,\n                        int chroma_height,int delta,int list,uint8_t *dest_y,\n                        uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,\n                        int src_y_offset,qpel_mc_func *qpix_op,\n                        h264_chroma_mc_func chroma_op,vector_t *mv){\n    MpegEncContext * const s = &h->s;\n    const int mx= mv->x + src_x_offset*8;\n    const int my= mv->y + src_y_offset*8;\n    const int luma_xy= (mx&3) + ((my&3)<<2);\n    uint8_t * src_y = pic->data[0] + (mx>>2) + (my>>2)*h->l_stride;\n    uint8_t * src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->c_stride;\n    uint8_t * src_cr= pic->data[2] + (mx>>3) + (my>>3)*h->c_stride;\n    int extra_width= 0;\n    int extra_height= extra_width;\n    int emu=0;\n    const int full_mx= mx>>2;\n    const int full_my= my>>2;\n    const int pic_width  = 16*h->mb_width;\n    const int pic_height = 16*h->mb_height;\n    if(!pic->data[0])\n        return;\n    if(mx&7) extra_width -= 3;\n    if(my&7) extra_height -= 3;\n    if(   full_mx < 0-extra_width\n          || full_my < 0-extra_height\n          || full_mx + 16  > pic_width + extra_width\n          || full_my + 16  > pic_height + extra_height){\n        ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride,\n                            16+5, 16+5 , full_mx-2, full_my-2, pic_width, pic_height);\n        src_y= s->edge_emu_buffer + 2 + 2*h->l_stride;\n        emu=1;\n    }\n    qpix_op[luma_xy](dest_y, src_y, h->l_stride);\n    if(!square){\n        qpix_op[luma_xy](dest_y + delta, src_y + delta, h->l_stride);\n    }\n    if(emu){\n        ff_emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride,\n                            9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);\n        src_cb= s->edge_emu_buffer;\n    }\n    chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7);\n    if(emu){\n        ff_emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride,\n                            9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);\n        src_cr= s->edge_emu_buffer;\n    }\n    chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7);\n}']