libavcodec/h264_loopfilter.c:282: error: Buffer Overrun L2
  Offset: [3, 4] Size: 4 by call to `filter_mb_edgeh`.

libavcodec/h264_loopfilter.c:273:39: Assignment
271.     if( IS_INTRA(mb_type) ) {
272.         static const int16_t bS4[4] = {4,4,4,4};
273.         static const int16_t bS3[4] = {3,3,3,3};
                                           ^
274.         const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4;
275.         if(left_type)

libavcodec/h264_loopfilter.c:282:13: Call
280.                 filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
281.             }
282.             filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);
                 ^
283.         } else {
284.             filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);

libavcodec/h264_loopfilter.c:194:1: <Offset trace>
192. }
193. 
194. static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride,
     ^
195.                                              const int16_t bS[4],
196.                                              unsigned int qp, int a, int b,

libavcodec/h264_loopfilter.c:194:1: Parameter `*bS`
  192. }
  193. 
  194. static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride,
       ^
  195.                                              const int16_t bS[4],
  196.                                              unsigned int qp, int a, int b,

libavcodec/h264_loopfilter.c:73:1: <Length trace>
71.     18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
72. };
73. static const uint8_t tc0_table[52*3][4] = {
    ^
74.     {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
75.     {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },

libavcodec/h264_loopfilter.c:73:1: Array declaration
  71.     18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
  72. };
  73. static const uint8_t tc0_table[52*3][4] = {
      ^
  74.     {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
  75.     {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },

libavcodec/h264_loopfilter.c:206:17: Array access: Offset: [3, 4] Size: 4 by call to `filter_mb_edgeh` 
  204.     if( bS[0] < 4 || !intra ) {
  205.         int8_t tc[4];
  206.         tc[0] = tc0_table[index_a][bS[0]];
                       ^
  207.         tc[1] = tc0_table[index_a][bS[1]];
  208.         tc[2] = tc0_table[index_a][bS[2]];

static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride,
                                             const int16_t bS[4],
                                             unsigned int qp, int a, int b,
                                             H264Context *h, int intra)
{
    const unsigned int index_a = qp + a;
    const int alpha = alpha_table[index_a];
    const int beta  = beta_table[qp + b];
    if (alpha ==0 || beta == 0) return;
    if( bS[0] < 4 || !intra ) {
        int8_t tc[4];
        tc[0] = tc0_table[index_a][bS[0]];
        tc[1] = tc0_table[index_a][bS[1]];
        tc[2] = tc0_table[index_a][bS[2]];
        tc[3] = tc0_table[index_a][bS[3]];
        h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
    } else {
        h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
    }
}
['static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,\n                                                          int mb_x, int mb_y,\n                                                          uint8_t *img_y,\n                                                          uint8_t *img_cb,\n                                                          uint8_t *img_cr,\n                                                          unsigned int linesize,\n                                                          unsigned int uvlinesize,\n                                                          int pixel_shift)\n{\n    int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));\n    int chroma444 = CHROMA444(h);\n    int chroma422 = CHROMA422(h);\n    int mb_xy = h->mb_xy;\n    int left_type= h->left_type[LTOP];\n    int top_type= h->top_type;\n    int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);\n    int a = h->slice_alpha_c0_offset - qp_bd_offset;\n    int b = h->slice_beta_offset - qp_bd_offset;\n    int mb_type = h->cur_pic.mb_type[mb_xy];\n    int qp      = h->cur_pic.qscale_table[mb_xy];\n    int qp0     = h->cur_pic.qscale_table[mb_xy - 1];\n    int qp1     = h->cur_pic.qscale_table[h->top_mb_xy];\n    int qpc = get_chroma_qp( h, 0, qp );\n    int qpc0 = get_chroma_qp( h, 0, qp0 );\n    int qpc1 = get_chroma_qp( h, 0, qp1 );\n    qp0 = (qp + qp0 + 1) >> 1;\n    qp1 = (qp + qp1 + 1) >> 1;\n    qpc0 = (qpc + qpc0 + 1) >> 1;\n    qpc1 = (qpc + qpc1 + 1) >> 1;\n    if( IS_INTRA(mb_type) ) {\n        static const int16_t bS4[4] = {4,4,4,4};\n        static const int16_t bS3[4] = {3,3,3,3};\n        const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4;\n        if(left_type)\n            filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1);\n        if( IS_8x8DCT(mb_type) ) {\n            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            if(top_type){\n                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);\n            }\n            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);\n        } else {\n            filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgev( &img_y[4*3<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            if(top_type){\n                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);\n            }\n            filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, a, b, h, 0);\n        }\n        if(chroma){\n            if(chroma444){\n                if(left_type){\n                    filter_mb_edgev( &img_cb[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgev( &img_cr[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);\n                }\n                if( IS_8x8DCT(mb_type) ) {\n                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    if(top_type){\n                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );\n                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );\n                    }\n                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                } else {\n                    filter_mb_edgev( &img_cb[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cb[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    if(top_type){\n                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);\n                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);\n                    }\n                    filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cb[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);\n                }\n            }else if(chroma422){\n                if(left_type){\n                    filter_mb_edgecv(&img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgecv(&img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                }\n                filter_mb_edgecv(&img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgecv(&img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                if(top_type){\n                    filter_mb_edgech(&img_cb[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                    filter_mb_edgech(&img_cr[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                }\n                filter_mb_edgech(&img_cb[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cb[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cb[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n            }else{\n                if(left_type){\n                    filter_mb_edgecv( &img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgecv( &img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                }\n                filter_mb_edgecv( &img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgecv( &img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                if(top_type){\n                    filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                    filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                }\n                filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n            }\n        }\n        return;\n    } else {\n        LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);\n        int edges;\n        if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 && !chroma444 ) {\n            edges = 4;\n            AV_WN64A(bS[0][0], 0x0002000200020002ULL);\n            AV_WN64A(bS[0][2], 0x0002000200020002ULL);\n            AV_WN64A(bS[1][0], 0x0002000200020002ULL);\n            AV_WN64A(bS[1][2], 0x0002000200020002ULL);\n        } else {\n            int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4);\n            int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1);\n            int step =  1+(mb_type>>24);\n            edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15));\n            h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,\n                                              h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h));\n        }\n        if( IS_INTRA(left_type) )\n            AV_WN64A(bS[0][0], 0x0004000400040004ULL);\n        if( IS_INTRA(top_type) )\n            AV_WN64A(bS[1][0], FIELD_PICTURE(h) ? 0x0003000300030003ULL : 0x0004000400040004ULL);\n#define FILTER(hv,dir,edge,intra)\\\n        if(AV_RN64A(bS[dir][edge])) {                                   \\\n            filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qp : qp##dir, a, b, h, intra );\\\n            if(chroma){\\\n                if(chroma444){\\\n                    filter_mb_edge##hv( &img_cb[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                    filter_mb_edge##hv( &img_cr[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                } else if(!(edge&1)) {\\\n                    filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                    filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                }\\\n            }\\\n        }\n        if(left_type)\n            FILTER(v,0,0,1);\n        if( edges == 1 ) {\n            if(top_type)\n                FILTER(h,1,0,1);\n        } else if( IS_8x8DCT(mb_type) ) {\n            FILTER(v,0,2,0);\n            if(top_type)\n                FILTER(h,1,0,1);\n            FILTER(h,1,2,0);\n        } else {\n            FILTER(v,0,1,0);\n            FILTER(v,0,2,0);\n            FILTER(v,0,3,0);\n            if(top_type)\n                FILTER(h,1,0,1);\n            FILTER(h,1,1,0);\n            FILTER(h,1,2,0);\n            FILTER(h,1,3,0);\n        }\n#undef FILTER\n    }\n}', 'static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride,\n                                             const int16_t bS[4],\n                                             unsigned int qp, int a, int b,\n                                             H264Context *h, int intra)\n{\n    const unsigned int index_a = qp + a;\n    const int alpha = alpha_table[index_a];\n    const int beta  = beta_table[qp + b];\n    if (alpha ==0 || beta == 0) return;\n    if( bS[0] < 4 || !intra ) {\n        int8_t tc[4];\n        tc[0] = tc0_table[index_a][bS[0]];\n        tc[1] = tc0_table[index_a][bS[1]];\n        tc[2] = tc0_table[index_a][bS[2]];\n        tc[3] = tc0_table[index_a][bS[3]];\n        h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);\n    } else {\n        h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);\n    }\n}']