libavcodec/h264.c:1883: error: Buffer Overrun L1
  Offset: -1 Size: 2 by call to `hl_decode_mb_predict_luma`.

libavcodec/h264.c:1883:13: Call
1881.             }
1882. 
1883.             hl_decode_mb_predict_luma(h, mb_type, is_h264, simple, transform_bypass, pixel_shift, block_offset, linesize, dest_y, 0);
                  ^
1884. 
1885.             if(h->deblocking_filter)

libavcodec/h264.c:1629:1: <Offset trace>
1627. }
1628. 
1629. static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,
      ^
1630.                                                        int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
1631. {

libavcodec/h264.c:1629:1: Parameter `p`
  1627. }
  1628. 
  1629. static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,
        ^
  1630.                                                        int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
  1631. {

libavcodec/h264.c:1629:1: <Length trace>
1627. }
1628. 
1629. static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,
      ^
1630.                                                        int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
1631. {

libavcodec/h264.c:1629:1: Parameter `h->chroma_qp[*]`
  1627. }
  1628. 
  1629. static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,
        ^
  1630.                                                        int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
  1631. {

libavcodec/h264.c:1636:39: Array access: Offset: -1 Size: 2 by call to `hl_decode_mb_predict_luma` 
  1634.     void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
  1635.     int i;
  1636.     int qscale = p == 0 ? s->qscale : h->chroma_qp[p-1];
                                              ^
  1637.     block_offset += 16*p;
  1638.     if(IS_INTRA4x4(mb_type)){

static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,
                                                       int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
{
    MpegEncContext * const s = &h->s;
    void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
    void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
    int i;
    int qscale = p == 0 ? s->qscale : h->chroma_qp[p-1];
    block_offset += 16*p;
    if(IS_INTRA4x4(mb_type)){
        if(simple || !s->encoding){
            if(IS_8x8DCT(mb_type)){
                if(transform_bypass){
                    idct_dc_add =
                    idct_add    = s->dsp.add_pixels8;
                }else{
                    idct_dc_add = h->h264dsp.h264_idct8_dc_add;
                    idct_add    = h->h264dsp.h264_idct8_add;
                }
                for(i=0; i<16; i+=4){
                    uint8_t * const ptr= dest_y + block_offset[i];
                    const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
                    if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
                        h->hpc.pred8x8l_add[dir](ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                    }else{
                        const int nnz = h->non_zero_count_cache[ scan8[i+p*16] ];
                        h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
                                                    (h->topright_samples_available<<i)&0x4000, linesize);
                        if(nnz){
                            if(nnz == 1 && dctcoef_get(h->mb, pixel_shift, i*16+p*256))
                                idct_dc_add(ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                            else
                                idct_add   (ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                        }
                    }
                }
            }else{
                if(transform_bypass){
                    idct_dc_add =
                    idct_add    = s->dsp.add_pixels4;
                }else{
                    idct_dc_add = h->h264dsp.h264_idct_dc_add;
                    idct_add    = h->h264dsp.h264_idct_add;
                }
                for(i=0; i<16; i++){
                    uint8_t * const ptr= dest_y + block_offset[i];
                    const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
                    if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
                        h->hpc.pred4x4_add[dir](ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                    }else{
                        uint8_t *topright;
                        int nnz, tr;
                        uint64_t tr_high;
                        if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
                            const int topright_avail= (h->topright_samples_available<<i)&0x8000;
                            assert(mb_y || linesize <= block_offset[i]);
                            if(!topright_avail){
                                if (pixel_shift) {
                                    tr_high= ((uint16_t*)ptr)[3 - linesize/2]*0x0001000100010001ULL;
                                    topright= (uint8_t*) &tr_high;
                                } else {
                                    tr= ptr[3 - linesize]*0x01010101;
                                    topright= (uint8_t*) &tr;
                                }
                            }else
                                topright= ptr + (4 << pixel_shift) - linesize;
                        }else
                            topright= NULL;
                        h->hpc.pred4x4[ dir ](ptr, topright, linesize);
                        nnz = h->non_zero_count_cache[ scan8[i+p*16] ];
                        if(nnz){
                            if(is_h264){
                                if(nnz == 1 && dctcoef_get(h->mb, pixel_shift, i*16+p*256))
                                    idct_dc_add(ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                                else
                                    idct_add   (ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);
                            }else
                                ff_svq3_add_idct_c(ptr, h->mb + i*16+p*256, linesize, qscale, 0);
                        }
                    }
                }
            }
        }
    }else{
        h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
        if(is_h264){
            if(h->non_zero_count_cache[ scan8[LUMA_DC_BLOCK_INDEX+p] ]){
                if(!transform_bypass)
                    h->h264dsp.h264_luma_dc_dequant_idct(h->mb+(p*256 << pixel_shift), h->mb_luma_dc[p], h->dequant4_coeff[p][qscale][0]);
                else{
                    static const uint8_t dc_mapping[16] = { 0*16, 1*16, 4*16, 5*16, 2*16, 3*16, 6*16, 7*16,
                                                            8*16, 9*16,12*16,13*16,10*16,11*16,14*16,15*16};
                    for(i = 0; i < 16; i++)
                        dctcoef_set(h->mb+p*256, pixel_shift, dc_mapping[i], dctcoef_get(h->mb_luma_dc[p], pixel_shift, i));
                }
            }
        }else
            ff_svq3_luma_dc_dequant_idct_c(h->mb+p*256, h->mb_luma_dc[p], qscale);
    }
}
['static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, int pixel_shift){\n    MpegEncContext * const s = &h->s;\n    const int mb_x= s->mb_x;\n    const int mb_y= s->mb_y;\n    const int mb_xy= h->mb_xy;\n    const int mb_type= s->current_picture.mb_type[mb_xy];\n    uint8_t  *dest_y, *dest_cb, *dest_cr;\n    int linesize, uvlinesize  ;\n    int i, j;\n    int *block_offset = &h->block_offset[0];\n    const int transform_bypass = !simple && (s->qscale == 0 && h->sps.transform_bypass);\n    const int is_h264 = !CONFIG_SVQ3_DECODER || simple || s->codec_id == CODEC_ID_H264;\n    void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);\n    dest_y  = s->current_picture.data[0] + ((mb_x << pixel_shift) + mb_y * s->linesize  ) * 16;\n    dest_cb = s->current_picture.data[1] + ((mb_x << pixel_shift) + mb_y * s->uvlinesize) * 8;\n    dest_cr = s->current_picture.data[2] + ((mb_x << pixel_shift) + mb_y * s->uvlinesize) * 8;\n    s->dsp.prefetch(dest_y + (s->mb_x&3)*4*s->linesize + (64 << pixel_shift), s->linesize, 4);\n    s->dsp.prefetch(dest_cb + (s->mb_x&7)*s->uvlinesize + (64 << pixel_shift), dest_cr - dest_cb, 2);\n    h->list_counts[mb_xy]= h->list_count;\n    if (!simple && MB_FIELD) {\n        linesize   = h->mb_linesize   = s->linesize * 2;\n        uvlinesize = h->mb_uvlinesize = s->uvlinesize * 2;\n        block_offset = &h->block_offset[48];\n        if(mb_y&1){\n            dest_y -= s->linesize*15;\n            dest_cb-= s->uvlinesize*7;\n            dest_cr-= s->uvlinesize*7;\n        }\n        if(FRAME_MBAFF) {\n            int list;\n            for(list=0; list<h->list_count; list++){\n                if(!USES_LIST(mb_type, list))\n                    continue;\n                if(IS_16X16(mb_type)){\n                    int8_t *ref = &h->ref_cache[list][scan8[0]];\n                    fill_rectangle(ref, 4, 4, 8, (16+*ref)^(s->mb_y&1), 1);\n                }else{\n                    for(i=0; i<16; i+=4){\n                        int ref = h->ref_cache[list][scan8[i]];\n                        if(ref >= 0)\n                            fill_rectangle(&h->ref_cache[list][scan8[i]], 2, 2, 8, (16+ref)^(s->mb_y&1), 1);\n                    }\n                }\n            }\n        }\n    } else {\n        linesize   = h->mb_linesize   = s->linesize;\n        uvlinesize = h->mb_uvlinesize = s->uvlinesize;\n    }\n    if (!simple && IS_INTRA_PCM(mb_type)) {\n        if (pixel_shift) {\n            const int bit_depth = h->sps.bit_depth_luma;\n            int j;\n            GetBitContext gb;\n            init_get_bits(&gb, (uint8_t*)h->mb, 384*bit_depth);\n            for (i = 0; i < 16; i++) {\n                uint16_t *tmp_y  = (uint16_t*)(dest_y  + i*linesize);\n                for (j = 0; j < 16; j++)\n                    tmp_y[j] = get_bits(&gb, bit_depth);\n            }\n            if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){\n                for (i = 0; i < 8; i++) {\n                    uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);\n                    for (j = 0; j < 8; j++)\n                        tmp_cb[j] = get_bits(&gb, bit_depth);\n                }\n                for (i = 0; i < 8; i++) {\n                    uint16_t *tmp_cr = (uint16_t*)(dest_cr + i*uvlinesize);\n                    for (j = 0; j < 8; j++)\n                        tmp_cr[j] = get_bits(&gb, bit_depth);\n                }\n            }\n        } else {\n            for (i=0; i<16; i++) {\n                memcpy(dest_y + i*  linesize, h->mb       + i*8, 16);\n            }\n            if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){\n                for (i=0; i<8; i++) {\n                    memcpy(dest_cb+ i*uvlinesize, h->mb + 128 + i*4,  8);\n                    memcpy(dest_cr+ i*uvlinesize, h->mb + 160 + i*4,  8);\n                }\n            }\n        }\n    } else {\n        if(IS_INTRA(mb_type)){\n            if(h->deblocking_filter)\n                xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 1, 0, simple, pixel_shift);\n            if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){\n                h->hpc.pred8x8[ h->chroma_pred_mode ](dest_cb, uvlinesize);\n                h->hpc.pred8x8[ h->chroma_pred_mode ](dest_cr, uvlinesize);\n            }\n            hl_decode_mb_predict_luma(h, mb_type, is_h264, simple, transform_bypass, pixel_shift, block_offset, linesize, dest_y, 0);\n            if(h->deblocking_filter)\n                xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0, 0, simple, pixel_shift);\n        }else if(is_h264){\n            if (pixel_shift) {\n                hl_motion_16(h, dest_y, dest_cb, dest_cr,\n                             s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,\n                             s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,\n                             h->h264dsp.weight_h264_pixels_tab,\n                             h->h264dsp.biweight_h264_pixels_tab, 0);\n            } else\n                hl_motion_8(h, dest_y, dest_cb, dest_cr,\n                            s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,\n                            s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,\n                            h->h264dsp.weight_h264_pixels_tab,\n                            h->h264dsp.biweight_h264_pixels_tab, 0);\n        }\n        hl_decode_mb_idct_luma(h, mb_type, is_h264, simple, transform_bypass, pixel_shift, block_offset, linesize, dest_y, 0);\n        if((simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)) && (h->cbp&0x30)){\n            uint8_t *dest[2] = {dest_cb, dest_cr};\n            if(transform_bypass){\n                if(IS_INTRA(mb_type) && h->sps.profile_idc==244 && (h->chroma_pred_mode==VERT_PRED8x8 || h->chroma_pred_mode==HOR_PRED8x8)){\n                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0], block_offset + 16, h->mb + (16*16*1 << pixel_shift), uvlinesize);\n                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1], block_offset + 32, h->mb + (16*16*2 << pixel_shift), uvlinesize);\n                }else{\n                    idct_add = s->dsp.add_pixels4;\n                    for(j=1; j<3; j++){\n                        for(i=j*16; i<j*16+4; i++){\n                            if(h->non_zero_count_cache[ scan8[i] ] || dctcoef_get(h->mb, pixel_shift, i*16))\n                                idct_add   (dest[j-1] + block_offset[i], h->mb + (i*16 << pixel_shift), uvlinesize);\n                        }\n                    }\n                }\n            }else{\n                if(is_h264){\n                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+0] ])\n                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16*16*1 << pixel_shift), h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);\n                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+1] ])\n                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16*16*2 << pixel_shift), h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);\n                    h->h264dsp.h264_idct_add8(dest, block_offset,\n                                              h->mb, uvlinesize,\n                                              h->non_zero_count_cache);\n                }else{\n                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16*1, h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);\n                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16*2, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);\n                    for(j=1; j<3; j++){\n                        for(i=j*16; i<j*16+4; i++){\n                            if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){\n                                uint8_t * const ptr= dest[j-1] + block_offset[i];\n                                ff_svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, ff_h264_chroma_qp[0][s->qscale + 12] - 12, 2);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n    if(h->cbp || IS_INTRA(mb_type))\n    {\n        s->dsp.clear_blocks(h->mb);\n        s->dsp.clear_blocks(h->mb+(24*16<<pixel_shift));\n    }\n}', 'static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass,\n                                                       int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)\n{\n    MpegEncContext * const s = &h->s;\n    void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);\n    void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);\n    int i;\n    int qscale = p == 0 ? s->qscale : h->chroma_qp[p-1];\n    block_offset += 16*p;\n    if(IS_INTRA4x4(mb_type)){\n        if(simple || !s->encoding){\n            if(IS_8x8DCT(mb_type)){\n                if(transform_bypass){\n                    idct_dc_add =\n                    idct_add    = s->dsp.add_pixels8;\n                }else{\n                    idct_dc_add = h->h264dsp.h264_idct8_dc_add;\n                    idct_add    = h->h264dsp.h264_idct8_add;\n                }\n                for(i=0; i<16; i+=4){\n                    uint8_t * const ptr= dest_y + block_offset[i];\n                    const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];\n                    if(transform_bypass && h->sps.profile_idc==244 && dir<=1){\n                        h->hpc.pred8x8l_add[dir](ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                    }else{\n                        const int nnz = h->non_zero_count_cache[ scan8[i+p*16] ];\n                        h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,\n                                                    (h->topright_samples_available<<i)&0x4000, linesize);\n                        if(nnz){\n                            if(nnz == 1 && dctcoef_get(h->mb, pixel_shift, i*16+p*256))\n                                idct_dc_add(ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                            else\n                                idct_add   (ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                        }\n                    }\n                }\n            }else{\n                if(transform_bypass){\n                    idct_dc_add =\n                    idct_add    = s->dsp.add_pixels4;\n                }else{\n                    idct_dc_add = h->h264dsp.h264_idct_dc_add;\n                    idct_add    = h->h264dsp.h264_idct_add;\n                }\n                for(i=0; i<16; i++){\n                    uint8_t * const ptr= dest_y + block_offset[i];\n                    const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];\n                    if(transform_bypass && h->sps.profile_idc==244 && dir<=1){\n                        h->hpc.pred4x4_add[dir](ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                    }else{\n                        uint8_t *topright;\n                        int nnz, tr;\n                        uint64_t tr_high;\n                        if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){\n                            const int topright_avail= (h->topright_samples_available<<i)&0x8000;\n                            assert(mb_y || linesize <= block_offset[i]);\n                            if(!topright_avail){\n                                if (pixel_shift) {\n                                    tr_high= ((uint16_t*)ptr)[3 - linesize/2]*0x0001000100010001ULL;\n                                    topright= (uint8_t*) &tr_high;\n                                } else {\n                                    tr= ptr[3 - linesize]*0x01010101;\n                                    topright= (uint8_t*) &tr;\n                                }\n                            }else\n                                topright= ptr + (4 << pixel_shift) - linesize;\n                        }else\n                            topright= NULL;\n                        h->hpc.pred4x4[ dir ](ptr, topright, linesize);\n                        nnz = h->non_zero_count_cache[ scan8[i+p*16] ];\n                        if(nnz){\n                            if(is_h264){\n                                if(nnz == 1 && dctcoef_get(h->mb, pixel_shift, i*16+p*256))\n                                    idct_dc_add(ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                                else\n                                    idct_add   (ptr, h->mb + (i*16+p*256 << pixel_shift), linesize);\n                            }else\n                                ff_svq3_add_idct_c(ptr, h->mb + i*16+p*256, linesize, qscale, 0);\n                        }\n                    }\n                }\n            }\n        }\n    }else{\n        h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);\n        if(is_h264){\n            if(h->non_zero_count_cache[ scan8[LUMA_DC_BLOCK_INDEX+p] ]){\n                if(!transform_bypass)\n                    h->h264dsp.h264_luma_dc_dequant_idct(h->mb+(p*256 << pixel_shift), h->mb_luma_dc[p], h->dequant4_coeff[p][qscale][0]);\n                else{\n                    static const uint8_t dc_mapping[16] = { 0*16, 1*16, 4*16, 5*16, 2*16, 3*16, 6*16, 7*16,\n                                                            8*16, 9*16,12*16,13*16,10*16,11*16,14*16,15*16};\n                    for(i = 0; i < 16; i++)\n                        dctcoef_set(h->mb+p*256, pixel_shift, dc_mapping[i], dctcoef_get(h->mb_luma_dc[p], pixel_shift, i));\n                }\n            }\n        }else\n            ff_svq3_luma_dc_dequant_idct_c(h->mb+p*256, h->mb_luma_dc[p], qscale);\n    }\n}']