libavcodec/h264_loopfilter.c:676: error: Buffer Overrun L2
  Offset: [0, 1125917086973956] Size: 4 by call to `filter_mb_mbaff_edgev`.

libavcodec/h264_loopfilter.c:639:13: Assignment
637.         if( IS_INTRA(mb_type) )
638.             *(uint64_t*)&bS[0]=
639.             *(uint64_t*)&bS[4]= 0x0004000400040004ULL;
                 ^
640.         else {
641.             for( i = 0; i < 8; i++ ) {

libavcodec/h264_loopfilter.c:676:13: Call
674.         if(MB_FIELD){
675.             filter_mb_mbaff_edgev ( h, img_y                ,   linesize, bS  , 1, qp [0] );
676.             filter_mb_mbaff_edgev ( h, img_y  + 8*  linesize,   linesize, bS+4, 1, qp [1] );
                 ^
677.             filter_mb_mbaff_edgecv( h, img_cb,                uvlinesize, bS  , 1, bqp[0] );
678.             filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] );

libavcodec/h264_loopfilter.c:137:1: <Offset trace>
135. }
136. 
137. static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
     ^
138.     int i;
139.     int index_a = qp + h->slice_alpha_c0_offset;

libavcodec/h264_loopfilter.c:137:1: Parameter `*bS`
  135. }
  136. 
  137. static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
       ^
  138.     int i;
  139.     int index_a = qp + h->slice_alpha_c0_offset;

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

libavcodec/h264_loopfilter.c:72:1: Array declaration
  70.     18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
  71. };
  72. static const uint8_t tc0_table[52*3][4] = {
      ^
  73.     {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
  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 },

libavcodec/h264_loopfilter.c:150:29: Array access: Offset: [0, 1125917086973956] Size: 4 by call to `filter_mb_mbaff_edgev` 
  148. 
  149.         if( bS[bS_index] < 4 ) {
  150.             const int tc0 = tc0_table[index_a][bS[bS_index]];
                                   ^
  151.             const int p0 = pix[-1];
  152.             const int p1 = pix[-2];

static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
    int i;
    int index_a = qp + h->slice_alpha_c0_offset;
    int alpha = alpha_table[index_a];
    int beta  = beta_table[qp + h->slice_beta_offset];
    for( i = 0; i < 8; i++, pix += stride) {
        const int bS_index = (i >> 1) * bsi;
        if( bS[bS_index] == 0 ) {
            continue;
        }
        if( bS[bS_index] < 4 ) {
            const int tc0 = tc0_table[index_a][bS[bS_index]];
            const int p0 = pix[-1];
            const int p1 = pix[-2];
            const int p2 = pix[-3];
            const int q0 = pix[0];
            const int q1 = pix[1];
            const int q2 = pix[2];
            if( FFABS( p0 - q0 ) < alpha &&
                FFABS( p1 - p0 ) < beta &&
                FFABS( q1 - q0 ) < beta ) {
                int tc = tc0;
                int i_delta;
                if( FFABS( p2 - p0 ) < beta ) {
                    if(tc0)
                    pix[-2] = p1 + av_clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 );
                    tc++;
                }
                if( FFABS( q2 - q0 ) < beta ) {
                    if(tc0)
                    pix[1] = q1 + av_clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 );
                    tc++;
                }
                i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
                pix[-1] = av_clip_uint8( p0 + i_delta );
                pix[0]  = av_clip_uint8( q0 - i_delta );
                tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);
            }
        }else{
            const int p0 = pix[-1];
            const int p1 = pix[-2];
            const int p2 = pix[-3];
            const int q0 = pix[0];
            const int q1 = pix[1];
            const int q2 = pix[2];
            if( FFABS( p0 - q0 ) < alpha &&
                FFABS( p1 - p0 ) < beta &&
                FFABS( q1 - q0 ) < beta ) {
                if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){
                    if( FFABS( p2 - p0 ) < beta)
                    {
                        const int p3 = pix[-4];
                        pix[-1] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;
                        pix[-2] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;
                        pix[-3] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;
                    } else {
                        pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
                    }
                    if( FFABS( q2 - q0 ) < beta)
                    {
                        const int q3 = pix[3];
                        pix[0] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;
                        pix[1] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;
                        pix[2] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;
                    } else {
                        pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
                    }
                }else{
                    pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
                    pix[ 0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
                }
                tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, p2, p1, p0, q0, q1, q2, pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);
            }
        }
    }
}
['void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {\n    MpegEncContext * const s = &h->s;\n    const int mb_xy= mb_x + mb_y*s->mb_stride;\n    const int mb_type = s->current_picture.mb_type[mb_xy];\n    const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;\n    int first_vertical_edge_done = 0;\n    av_unused int dir;\n    int list;\n    if (FRAME_MBAFF\n            && h->slice_table[mb_xy-1] != 0xFFFF\n            && IS_INTERLACED(mb_type^s->current_picture.mb_type[mb_xy-1])\n            && (h->deblocking_filter!=2 || h->slice_table[mb_xy-1] == h->slice_num)) {\n        const int pair_xy = mb_x + (mb_y&~1)*s->mb_stride;\n        const int left_mb_xy[2] = { pair_xy-1, pair_xy-1+s->mb_stride };\n        DECLARE_ALIGNED_8(int16_t, bS)[8];\n        int qp[2];\n        int bqp[2];\n        int rqp[2];\n        int mb_qp, mbn0_qp, mbn1_qp;\n        int i;\n        first_vertical_edge_done = 1;\n        if( IS_INTRA(mb_type) )\n            *(uint64_t*)&bS[0]=\n            *(uint64_t*)&bS[4]= 0x0004000400040004ULL;\n        else {\n            for( i = 0; i < 8; i++ ) {\n                int mbn_xy = MB_FIELD ? left_mb_xy[i>>2] : left_mb_xy[i&1];\n                if( IS_INTRA( s->current_picture.mb_type[mbn_xy] ) )\n                    bS[i] = 4;\n                else if( h->non_zero_count_cache[12+8*(i>>1)] != 0 ||\n                         ((!h->pps.cabac && IS_8x8DCT(s->current_picture.mb_type[mbn_xy])) ?\n                            (h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2))\n                                                                       :\n                            h->non_zero_count[mbn_xy][7+(MB_FIELD ? (i&3) : (i>>2)+(mb_y&1)*2)*8]))\n                    bS[i] = 2;\n                else\n                    bS[i] = 1;\n            }\n        }\n        mb_qp = s->current_picture.qscale_table[mb_xy];\n        mbn0_qp = s->current_picture.qscale_table[left_mb_xy[0]];\n        mbn1_qp = s->current_picture.qscale_table[left_mb_xy[1]];\n        qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;\n        bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) +\n                   get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1;\n        rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) +\n                   get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1;\n        qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;\n        bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) +\n                   get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1;\n        rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) +\n                   get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1;\n        tprintf(s->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);\n        { int i; for (i = 0; i < 8; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\\n"); }\n        if(MB_FIELD){\n            filter_mb_mbaff_edgev ( h, img_y                ,   linesize, bS  , 1, qp [0] );\n            filter_mb_mbaff_edgev ( h, img_y  + 8*  linesize,   linesize, bS+4, 1, qp [1] );\n            filter_mb_mbaff_edgecv( h, img_cb,                uvlinesize, bS  , 1, bqp[0] );\n            filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] );\n            filter_mb_mbaff_edgecv( h, img_cr,                uvlinesize, bS  , 1, rqp[0] );\n            filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1] );\n        }else{\n            filter_mb_mbaff_edgev ( h, img_y              , 2*  linesize, bS  , 2, qp [0] );\n            filter_mb_mbaff_edgev ( h, img_y  +   linesize, 2*  linesize, bS+1, 2, qp [1] );\n            filter_mb_mbaff_edgecv( h, img_cb,              2*uvlinesize, bS  , 2, bqp[0] );\n            filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1] );\n            filter_mb_mbaff_edgecv( h, img_cr,              2*uvlinesize, bS  , 2, rqp[0] );\n            filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1] );\n        }\n    }\n#if CONFIG_SMALL\n    for( dir = 0; dir < 2; dir++ )\n        filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, dir);\n#else\n    filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, 0);\n    filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, 1);\n#endif\n}', 'static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {\n    int i;\n    int index_a = qp + h->slice_alpha_c0_offset;\n    int alpha = alpha_table[index_a];\n    int beta  = beta_table[qp + h->slice_beta_offset];\n    for( i = 0; i < 8; i++, pix += stride) {\n        const int bS_index = (i >> 1) * bsi;\n        if( bS[bS_index] == 0 ) {\n            continue;\n        }\n        if( bS[bS_index] < 4 ) {\n            const int tc0 = tc0_table[index_a][bS[bS_index]];\n            const int p0 = pix[-1];\n            const int p1 = pix[-2];\n            const int p2 = pix[-3];\n            const int q0 = pix[0];\n            const int q1 = pix[1];\n            const int q2 = pix[2];\n            if( FFABS( p0 - q0 ) < alpha &&\n                FFABS( p1 - p0 ) < beta &&\n                FFABS( q1 - q0 ) < beta ) {\n                int tc = tc0;\n                int i_delta;\n                if( FFABS( p2 - p0 ) < beta ) {\n                    if(tc0)\n                    pix[-2] = p1 + av_clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 );\n                    tc++;\n                }\n                if( FFABS( q2 - q0 ) < beta ) {\n                    if(tc0)\n                    pix[1] = q1 + av_clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 );\n                    tc++;\n                }\n                i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );\n                pix[-1] = av_clip_uint8( p0 + i_delta );\n                pix[0]  = av_clip_uint8( q0 - i_delta );\n                tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);\n            }\n        }else{\n            const int p0 = pix[-1];\n            const int p1 = pix[-2];\n            const int p2 = pix[-3];\n            const int q0 = pix[0];\n            const int q1 = pix[1];\n            const int q2 = pix[2];\n            if( FFABS( p0 - q0 ) < alpha &&\n                FFABS( p1 - p0 ) < beta &&\n                FFABS( q1 - q0 ) < beta ) {\n                if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){\n                    if( FFABS( p2 - p0 ) < beta)\n                    {\n                        const int p3 = pix[-4];\n                        pix[-1] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;\n                        pix[-2] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;\n                        pix[-3] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;\n                    } else {\n                        pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;\n                    }\n                    if( FFABS( q2 - q0 ) < beta)\n                    {\n                        const int q3 = pix[3];\n                        pix[0] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;\n                        pix[1] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;\n                        pix[2] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;\n                    } else {\n                        pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;\n                    }\n                }else{\n                    pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;\n                    pix[ 0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;\n                }\n                tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\\n", i, qp[qp_index], index_a, alpha, beta, p2, p1, p0, q0, q1, q2, pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);\n            }\n        }\n    }\n}']