libavcodec/vp9block.c:1094: error: Buffer Overrun L3
  Offset: [-1, +oo] Size: 32 by call to `check_intra_mode`.

libavcodec/vp9block.c:1070:1: Array declaration
1068. }
1069. 
1070. static void intra_recon(AVCodecContext *avctx, ptrdiff_t y_off, ptrdiff_t uv_off)
      ^
1071. {
1072.     VP9Context *s = avctx->priv_data;

libavcodec/vp9block.c:1094:20: Call
1092.             int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n];
1093. 
1094.             mode = check_intra_mode(s, mode, &a, ptr_r,
                         ^
1095.                                     s->cur_frame->linesize[0],
1096.                                     ptr, b->y_stride, l,

libavcodec/vp9block.c:1058:22: <Offset trace>
1056.                     l[i] = dst[i * stride - 1];
1057.             } else {
1058.                 for (i = 0; i < n_px_have; i++)
                           ^
1059.                     l[i] = dst[i * stride - 1];
1060.                 memset(&l[i], l[i - 1], n_px_need - n_px_have);

libavcodec/vp9block.c:1058:22: Assignment
  1056.                     l[i] = dst[i * stride - 1];
  1057.             } else {
  1058.                 for (i = 0; i < n_px_have; i++)
                             ^
  1059.                     l[i] = dst[i * stride - 1];
  1060.                 memset(&l[i], l[i - 1], n_px_need - n_px_have);

libavcodec/vp9block.c:927:1: <Length trace>
925. }
926. 
927. static av_always_inline int check_intra_mode(VP9Context *s, int mode,
     ^
928.                                              uint8_t **a,
929.                                              uint8_t *dst_edge,

libavcodec/vp9block.c:927:1: Parameter `*l`
  925. }
  926. 
  927. static av_always_inline int check_intra_mode(VP9Context *s, int mode,
       ^
  928.                                              uint8_t **a,
  929.                                              uint8_t *dst_edge,

libavcodec/vp9block.c:1060:31: Array access: Offset: [-1, +oo] Size: 32 by call to `check_intra_mode` 
  1058.                 for (i = 0; i < n_px_have; i++)
  1059.                     l[i] = dst[i * stride - 1];
  1060.                 memset(&l[i], l[i - 1], n_px_need - n_px_have);
                                      ^
  1061.             }
  1062.         } else {

static av_always_inline int check_intra_mode(VP9Context *s, int mode,
                                             uint8_t **a,
                                             uint8_t *dst_edge,
                                             ptrdiff_t stride_edge,
                                             uint8_t *dst_inner,
                                             ptrdiff_t stride_inner,
                                             uint8_t *l, int col, int x, int w,
                                             int row, int y, enum TxfmMode tx,
                                             int p)
{
    int have_top   = row > 0 || y > 0;
    int have_left  = col > s->tiling.tile_col_start || x > 0;
    int have_right = x < w - 1;
    static const uint8_t mode_conv[10][2  ][2  ] = {
        [VERT_PRED]            = { { DC_127_PRED,          VERT_PRED            },
                                   { DC_127_PRED,          VERT_PRED            } },
        [HOR_PRED]             = { { DC_129_PRED,          DC_129_PRED          },
                                   { HOR_PRED,             HOR_PRED             } },
        [DC_PRED]              = { { DC_128_PRED,          TOP_DC_PRED          },
                                   { LEFT_DC_PRED,         DC_PRED              } },
        [DIAG_DOWN_LEFT_PRED]  = { { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  },
                                   { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  } },
        [DIAG_DOWN_RIGHT_PRED] = { { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED },
                                   { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED } },
        [VERT_RIGHT_PRED]      = { { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      },
                                   { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      } },
        [HOR_DOWN_PRED]        = { { HOR_DOWN_PRED,        HOR_DOWN_PRED        },
                                   { HOR_DOWN_PRED,        HOR_DOWN_PRED        } },
        [VERT_LEFT_PRED]       = { { DC_127_PRED,          VERT_LEFT_PRED       },
                                   { DC_127_PRED,          VERT_LEFT_PRED       } },
        [HOR_UP_PRED]          = { { DC_129_PRED,          DC_129_PRED          },
                                   { HOR_UP_PRED,          HOR_UP_PRED          } },
        [TM_VP8_PRED]          = { { DC_129_PRED,          VERT_PRED            },
                                   { HOR_PRED,             TM_VP8_PRED          } },
    };
    static const struct {
        uint8_t needs_left:1;
        uint8_t needs_top:1;
        uint8_t needs_topleft:1;
        uint8_t needs_topright:1;
    } edges[N_INTRA_PRED_MODES] = {
        [VERT_PRED]            = { .needs_top  = 1 },
        [HOR_PRED]             = { .needs_left = 1 },
        [DC_PRED]              = { .needs_top  = 1, .needs_left = 1 },
        [DIAG_DOWN_LEFT_PRED]  = { .needs_top  = 1, .needs_topright = 1 },
        [DIAG_DOWN_RIGHT_PRED] = { .needs_left = 1, .needs_top = 1,
                                   .needs_topleft = 1 },
        [VERT_RIGHT_PRED]      = { .needs_left = 1, .needs_top = 1,
                                   .needs_topleft = 1 },
        [HOR_DOWN_PRED]        = { .needs_left = 1, .needs_top = 1,
                                   .needs_topleft = 1 },
        [VERT_LEFT_PRED]       = { .needs_top  = 1, .needs_topright = 1 },
        [HOR_UP_PRED]          = { .needs_left = 1 },
        [TM_VP8_PRED]          = { .needs_left = 1, .needs_top = 1,
                                   .needs_topleft = 1 },
        [LEFT_DC_PRED]         = { .needs_left = 1 },
        [TOP_DC_PRED]          = { .needs_top  = 1 },
        [DC_128_PRED]          = { 0 },
        [DC_127_PRED]          = { 0 },
        [DC_129_PRED]          = { 0 }
    };
    av_assert2(mode >= 0 && mode < 10);
    mode = mode_conv[mode][have_left][have_top];
    if (edges[mode].needs_top) {
        uint8_t *top = NULL, *topleft = NULL;
        int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !p) - x) * 4;
        int n_px_need_tr = 0;
        if (tx == TX_4X4 && edges[mode].needs_topright && have_right)
            n_px_need_tr = 4;
        if (have_top) {
            top = !(row & 7) && !y ?
                  s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
                  y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];
            if (have_left)
                topleft = !(row & 7) && !y ?
                          s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
                          y == 0 || x == 0 ? &dst_edge[-stride_edge] :
                          &dst_inner[-stride_inner];
        }
        if (have_top &&
            (!edges[mode].needs_topleft || (have_left && top == topleft)) &&
            (tx != TX_4X4 || !edges[mode].needs_topright || have_right) &&
            n_px_need + n_px_need_tr <= n_px_have) {
            *a = top;
        } else {
            if (have_top) {
                if (n_px_need <= n_px_have) {
                    memcpy(*a, top, n_px_need);
                } else {
                    memcpy(*a, top, n_px_have);
                    memset(&(*a)[n_px_have], (*a)[n_px_have - 1],
                           n_px_need - n_px_have);
                }
            } else {
                memset(*a, 127, n_px_need);
            }
            if (edges[mode].needs_topleft) {
                if (have_left && have_top)
                    (*a)[-1] = topleft[-1];
                else
                    (*a)[-1] = have_top ? 129 : 127;
            }
            if (tx == TX_4X4 && edges[mode].needs_topright) {
                if (have_top && have_right &&
                    n_px_need + n_px_need_tr <= n_px_have) {
                    memcpy(&(*a)[4], &top[4], 4);
                } else {
                    memset(&(*a)[4], (*a)[3], 4);
                }
            }
        }
    }
    if (edges[mode].needs_left) {
        if (have_left) {
            int i;
            int n_px_need = 4 << tx;
            int n_px_have = (((s->rows - row) << !p) - y) * 4;
            uint8_t *dst     = x == 0 ? dst_edge : dst_inner;
            ptrdiff_t stride = x == 0 ? stride_edge : stride_inner;
            if (n_px_need <= n_px_have) {
                for (i = 0; i < n_px_need; i++)
                    l[i] = dst[i * stride - 1];
            } else {
                for (i = 0; i < n_px_have; i++)
                    l[i] = dst[i * stride - 1];
                memset(&l[i], l[i - 1], n_px_need - n_px_have);
            }
        } else {
            memset(l, 129, 4 << tx);
        }
    }
    return mode;
}
['static void intra_recon(AVCodecContext *avctx, ptrdiff_t y_off, ptrdiff_t uv_off)\n{\n    VP9Context *s = avctx->priv_data;\n    VP9Block *const b = &s->b;\n    int row = b->row, col = b->col;\n    int w4 = bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n;\n    int h4 = bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2);\n    int end_x = FFMIN(2 * (s->cols - col), w4);\n    int end_y = FFMIN(2 * (s->rows - row), h4);\n    int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless;\n    int uvstep1d = 1 << b->uvtx, p;\n    uint8_t *dst = b->dst[0], *dst_r = s->cur_frame->data[0] + y_off;\n    for (n = 0, y = 0; y < end_y; y += step1d) {\n        uint8_t *ptr = dst, *ptr_r = dst_r;\n        for (x = 0; x < end_x;\n             x += step1d, ptr += 4 * step1d, ptr_r += 4 * step1d, n += step) {\n            int mode = b->mode[b->bs > BS_8x8 && b->tx == TX_4X4 ?\n                               y * 2 + x : 0];\n            LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);\n            uint8_t *a = &a_buf[16], l[32];\n            enum TxfmType txtp = ff_vp9_intra_txfm_type[mode];\n            int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n];\n            mode = check_intra_mode(s, mode, &a, ptr_r,\n                                    s->cur_frame->linesize[0],\n                                    ptr, b->y_stride, l,\n                                    col, x, w4, row, y, b->tx, 0);\n            s->dsp.intra_pred[b->tx][mode](ptr, b->y_stride, l, a);\n            if (eob)\n                s->dsp.itxfm_add[tx][txtp](ptr, b->y_stride,\n                                           s->block + 16 * n, eob);\n        }\n        dst_r += 4 * s->cur_frame->linesize[0] * step1d;\n        dst   += 4 * b->y_stride * step1d;\n    }\n    h4    >>= 1;\n    w4    >>= 1;\n    end_x >>= 1;\n    end_y >>= 1;\n    step    = 1 << (b->uvtx * 2);\n    for (p = 0; p < 2; p++) {\n        dst   = b->dst[1 + p];\n        dst_r = s->cur_frame->data[1 + p] + uv_off;\n        for (n = 0, y = 0; y < end_y; y += uvstep1d) {\n            uint8_t *ptr = dst, *ptr_r = dst_r;\n            for (x = 0; x < end_x;\n                 x += uvstep1d, ptr += 4 * uvstep1d,\n                 ptr_r += 4 * uvstep1d, n += step) {\n                int mode = b->uvmode;\n                LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);\n                uint8_t *a = &a_buf[16], l[32];\n                int eob    = b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n])\n                                              : s->uveob[p][n];\n                mode = check_intra_mode(s, mode, &a, ptr_r,\n                                        s->cur_frame->linesize[1],\n                                        ptr, b->uv_stride, l,\n                                        col, x, w4, row, y, b->uvtx, p + 1);\n                s->dsp.intra_pred[b->uvtx][mode](ptr, b->uv_stride, l, a);\n                if (eob)\n                    s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, b->uv_stride,\n                                                    s->uvblock[p] + 16 * n,\n                                                    eob);\n            }\n            dst_r += 4 * uvstep1d * s->cur_frame->linesize[1];\n            dst   += 4 * uvstep1d * b->uv_stride;\n        }\n    }\n}', 'static av_always_inline int check_intra_mode(VP9Context *s, int mode,\n                                             uint8_t **a,\n                                             uint8_t *dst_edge,\n                                             ptrdiff_t stride_edge,\n                                             uint8_t *dst_inner,\n                                             ptrdiff_t stride_inner,\n                                             uint8_t *l, int col, int x, int w,\n                                             int row, int y, enum TxfmMode tx,\n                                             int p)\n{\n    int have_top   = row > 0 || y > 0;\n    int have_left  = col > s->tiling.tile_col_start || x > 0;\n    int have_right = x < w - 1;\n    static const uint8_t mode_conv[10][2  ][2  ] = {\n        [VERT_PRED]            = { { DC_127_PRED,          VERT_PRED            },\n                                   { DC_127_PRED,          VERT_PRED            } },\n        [HOR_PRED]             = { { DC_129_PRED,          DC_129_PRED          },\n                                   { HOR_PRED,             HOR_PRED             } },\n        [DC_PRED]              = { { DC_128_PRED,          TOP_DC_PRED          },\n                                   { LEFT_DC_PRED,         DC_PRED              } },\n        [DIAG_DOWN_LEFT_PRED]  = { { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  },\n                                   { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  } },\n        [DIAG_DOWN_RIGHT_PRED] = { { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED },\n                                   { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED } },\n        [VERT_RIGHT_PRED]      = { { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      },\n                                   { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      } },\n        [HOR_DOWN_PRED]        = { { HOR_DOWN_PRED,        HOR_DOWN_PRED        },\n                                   { HOR_DOWN_PRED,        HOR_DOWN_PRED        } },\n        [VERT_LEFT_PRED]       = { { DC_127_PRED,          VERT_LEFT_PRED       },\n                                   { DC_127_PRED,          VERT_LEFT_PRED       } },\n        [HOR_UP_PRED]          = { { DC_129_PRED,          DC_129_PRED          },\n                                   { HOR_UP_PRED,          HOR_UP_PRED          } },\n        [TM_VP8_PRED]          = { { DC_129_PRED,          VERT_PRED            },\n                                   { HOR_PRED,             TM_VP8_PRED          } },\n    };\n    static const struct {\n        uint8_t needs_left:1;\n        uint8_t needs_top:1;\n        uint8_t needs_topleft:1;\n        uint8_t needs_topright:1;\n    } edges[N_INTRA_PRED_MODES] = {\n        [VERT_PRED]            = { .needs_top  = 1 },\n        [HOR_PRED]             = { .needs_left = 1 },\n        [DC_PRED]              = { .needs_top  = 1, .needs_left = 1 },\n        [DIAG_DOWN_LEFT_PRED]  = { .needs_top  = 1, .needs_topright = 1 },\n        [DIAG_DOWN_RIGHT_PRED] = { .needs_left = 1, .needs_top = 1,\n                                   .needs_topleft = 1 },\n        [VERT_RIGHT_PRED]      = { .needs_left = 1, .needs_top = 1,\n                                   .needs_topleft = 1 },\n        [HOR_DOWN_PRED]        = { .needs_left = 1, .needs_top = 1,\n                                   .needs_topleft = 1 },\n        [VERT_LEFT_PRED]       = { .needs_top  = 1, .needs_topright = 1 },\n        [HOR_UP_PRED]          = { .needs_left = 1 },\n        [TM_VP8_PRED]          = { .needs_left = 1, .needs_top = 1,\n                                   .needs_topleft = 1 },\n        [LEFT_DC_PRED]         = { .needs_left = 1 },\n        [TOP_DC_PRED]          = { .needs_top  = 1 },\n        [DC_128_PRED]          = { 0 },\n        [DC_127_PRED]          = { 0 },\n        [DC_129_PRED]          = { 0 }\n    };\n    av_assert2(mode >= 0 && mode < 10);\n    mode = mode_conv[mode][have_left][have_top];\n    if (edges[mode].needs_top) {\n        uint8_t *top = NULL, *topleft = NULL;\n        int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !p) - x) * 4;\n        int n_px_need_tr = 0;\n        if (tx == TX_4X4 && edges[mode].needs_topright && have_right)\n            n_px_need_tr = 4;\n        if (have_top) {\n            top = !(row & 7) && !y ?\n                  s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :\n                  y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];\n            if (have_left)\n                topleft = !(row & 7) && !y ?\n                          s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :\n                          y == 0 || x == 0 ? &dst_edge[-stride_edge] :\n                          &dst_inner[-stride_inner];\n        }\n        if (have_top &&\n            (!edges[mode].needs_topleft || (have_left && top == topleft)) &&\n            (tx != TX_4X4 || !edges[mode].needs_topright || have_right) &&\n            n_px_need + n_px_need_tr <= n_px_have) {\n            *a = top;\n        } else {\n            if (have_top) {\n                if (n_px_need <= n_px_have) {\n                    memcpy(*a, top, n_px_need);\n                } else {\n                    memcpy(*a, top, n_px_have);\n                    memset(&(*a)[n_px_have], (*a)[n_px_have - 1],\n                           n_px_need - n_px_have);\n                }\n            } else {\n                memset(*a, 127, n_px_need);\n            }\n            if (edges[mode].needs_topleft) {\n                if (have_left && have_top)\n                    (*a)[-1] = topleft[-1];\n                else\n                    (*a)[-1] = have_top ? 129 : 127;\n            }\n            if (tx == TX_4X4 && edges[mode].needs_topright) {\n                if (have_top && have_right &&\n                    n_px_need + n_px_need_tr <= n_px_have) {\n                    memcpy(&(*a)[4], &top[4], 4);\n                } else {\n                    memset(&(*a)[4], (*a)[3], 4);\n                }\n            }\n        }\n    }\n    if (edges[mode].needs_left) {\n        if (have_left) {\n            int i;\n            int n_px_need = 4 << tx;\n            int n_px_have = (((s->rows - row) << !p) - y) * 4;\n            uint8_t *dst     = x == 0 ? dst_edge : dst_inner;\n            ptrdiff_t stride = x == 0 ? stride_edge : stride_inner;\n            if (n_px_need <= n_px_have) {\n                for (i = 0; i < n_px_need; i++)\n                    l[i] = dst[i * stride - 1];\n            } else {\n                for (i = 0; i < n_px_have; i++)\n                    l[i] = dst[i * stride - 1];\n                memset(&l[i], l[i - 1], n_px_need - n_px_have);\n            }\n        } else {\n            memset(l, 129, 4 << tx);\n        }\n    }\n    return mode;\n}']