libavcodec/vp9.c:1076: error: Buffer Overrun L2
  Offset: [2, 9] Size: 8.

libavcodec/vp9.c:1074:14: <Offset trace>
1072.         lvl = lflvl->level;
1073.         dst = f->data[1 + p] + uvoff;
1074.         for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {
                   ^
1075.             uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];
1076.             uint8_t *hmask2 = lflvl->mask[1][0][y + 2];

libavcodec/vp9.c:1074:14: Assignment
1072.         lvl = lflvl->level;
1073.         dst = f->data[1 + p] + uvoff;
1074.         for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {
                   ^
1075.             uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];
1076.             uint8_t *hmask2 = lflvl->mask[1][0][y + 2];

libavcodec/vp9.c:924:1: <Length trace>
922. }
923. 
924. static void loopfilter_subblock(AVCodecContext *avctx, VP9Filter *lflvl,
     ^
925.                                 int row, int col,
926.                                 ptrdiff_t yoff, ptrdiff_t uvoff)

libavcodec/vp9.c:924:1: Parameter `lflvl->mask[*][*][*]`
922. }
923. 
924. static void loopfilter_subblock(AVCodecContext *avctx, VP9Filter *lflvl,
     ^
925.                                 int row, int col,
926.                                 ptrdiff_t yoff, ptrdiff_t uvoff)

libavcodec/vp9.c:1076:13: Array access: Offset: [2, 9] Size: 8
1074.         for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {
1075.             uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];
1076.             uint8_t *hmask2 = lflvl->mask[1][0][y + 2];
                  ^
1077.             unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2];
1078.             unsigned hm2 = hmask2[1] | hmask2[2], hm = hm1 | hm2;

static void loopfilter_subblock(AVCodecContext *avctx, VP9Filter *lflvl,
                                int row, int col,
                                ptrdiff_t yoff, ptrdiff_t uvoff)
{
    VP9Context *s = avctx->priv_data;
    AVFrame    *f = s->frames[CUR_FRAME].tf.f;
    uint8_t *dst   = f->data[0] + yoff;
    ptrdiff_t ls_y = f->linesize[0], ls_uv = f->linesize[1];
    uint8_t *lvl = lflvl->level;
    int y, x, p;
    for (y = 0; y < 8; y += 2, dst += 16 * ls_y, lvl += 16) {
        uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[0][0][y];
        uint8_t *hmask2 = lflvl->mask[0][0][y + 1];
        unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];
        unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];
        unsigned hm  = hm1 | hm2 | hm13 | hm23;
        for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8, l++) {
            if (hm1 & x) {
                int L = *l, H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                if (col || x > 1) {
                    if (hmask1[0] & x) {
                        if (hmask2[0] & x) {
                            av_assert2(l[8] == L);
                            s->dsp.loop_filter_16[0](ptr, ls_y, E, I, H);
                        } else {
                            s->dsp.loop_filter_8[2][0](ptr, ls_y, E, I, H);
                        }
                    } else if (hm2 & x) {
                        L  = l[8];
                        H |= (L >> 4) << 8;
                        E |= s->filter.mblim_lut[L] << 8;
                        I |= s->filter.lim_lut[L] << 8;
                        s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
                                               [!!(hmask2[1] & x)]
                                               [0](ptr, ls_y, E, I, H);
                    } else {
                        s->dsp.loop_filter_8[!!(hmask1[1] & x)]
                                            [0](ptr, ls_y, E, I, H);
                    }
                }
            } else if (hm2 & x) {
                int L = l[8], H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                if (col || x > 1) {
                    s->dsp.loop_filter_8[!!(hmask2[1] & x)]
                                        [0](ptr + 8 * ls_y, ls_y, E, I, H);
                }
            }
            if (hm13 & x) {
                int L = *l, H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                if (hm23 & x) {
                    L  = l[8];
                    H |= (L >> 4) << 8;
                    E |= s->filter.mblim_lut[L] << 8;
                    I |= s->filter.lim_lut[L] << 8;
                    s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls_y, E, I, H);
                } else {
                    s->dsp.loop_filter_8[0][0](ptr + 4, ls_y, E, I, H);
                }
            } else if (hm23 & x) {
                int L = l[8], H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                s->dsp.loop_filter_8[0][0](ptr + 8 * ls_y + 4, ls_y, E, I, H);
            }
        }
    }
    dst = f->data[0] + yoff;
    lvl = lflvl->level;
    for (y = 0; y < 8; y++, dst += 8 * ls_y, lvl += 8) {
        uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[0][1][y];
        unsigned vm = vmask[0] | vmask[1] | vmask[2], vm3 = vmask[3];
        for (x = 1; vm & ~(x - 1); x <<= 2, ptr += 16, l += 2) {
            if (row || y) {
                if (vm & x) {
                    int L = *l, H = L >> 4;
                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                    if (vmask[0] & x) {
                        if (vmask[0] & (x << 1)) {
                            av_assert2(l[1] == L);
                            s->dsp.loop_filter_16[1](ptr, ls_y, E, I, H);
                        } else {
                            s->dsp.loop_filter_8[2][1](ptr, ls_y, E, I, H);
                        }
                    } else if (vm & (x << 1)) {
                        L  = l[1];
                        H |= (L >> 4) << 8;
                        E |= s->filter.mblim_lut[L] << 8;
                        I |= s->filter.lim_lut[L] << 8;
                        s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]
                                               [!!(vmask[1] & (x << 1))]
                                               [1](ptr, ls_y, E, I, H);
                    } else {
                        s->dsp.loop_filter_8[!!(vmask[1] & x)]
                                            [1](ptr, ls_y, E, I, H);
                    }
                } else if (vm & (x << 1)) {
                    int L = l[1], H = L >> 4;
                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                    s->dsp.loop_filter_8[!!(vmask[1] & (x << 1))]
                                        [1](ptr + 8, ls_y, E, I, H);
                }
            }
            if (vm3 & x) {
                int L = *l, H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                if (vm3 & (x << 1)) {
                    L  = l[1];
                    H |= (L >> 4) << 8;
                    E |= s->filter.mblim_lut[L] << 8;
                    I |= s->filter.lim_lut[L] << 8;
                    s->dsp.loop_filter_mix2[0][0][1](ptr + ls_y * 4, ls_y, E, I, H);
                } else {
                    s->dsp.loop_filter_8[0][1](ptr + ls_y * 4, ls_y, E, I, H);
                }
            } else if (vm3 & (x << 1)) {
                int L = l[1], H = L >> 4;
                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
                s->dsp.loop_filter_8[0][1](ptr + ls_y * 4 + 8, ls_y, E, I, H);
            }
        }
    }
    for (p = 0; p < 2; p++) {
        lvl = lflvl->level;
        dst = f->data[1 + p] + uvoff;
        for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {
            uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];
            uint8_t *hmask2 = lflvl->mask[1][0][y + 2];
            unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2];
            unsigned hm2 = hmask2[1] | hmask2[2], hm = hm1 | hm2;
            for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 4) {
                if (col || x > 1) {
                    if (hm1 & x) {
                        int L = *l, H = L >> 4;
                        int E = s->filter.mblim_lut[L];
                        int I = s->filter.lim_lut[L];
                        if (hmask1[0] & x) {
                            if (hmask2[0] & x) {
                                av_assert2(l[16] == L);
                                s->dsp.loop_filter_16[0](ptr, ls_uv, E, I, H);
                            } else {
                                s->dsp.loop_filter_8[2][0](ptr, ls_uv, E, I, H);
                            }
                        } else if (hm2 & x) {
                            L  = l[16];
                            H |= (L >> 4) << 8;
                            E |= s->filter.mblim_lut[L] << 8;
                            I |= s->filter.lim_lut[L] << 8;
                            s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
                                                   [!!(hmask2[1] & x)]
                                                   [0](ptr, ls_uv, E, I, H);
                        } else {
                            s->dsp.loop_filter_8[!!(hmask1[1] & x)]
                                                [0](ptr, ls_uv, E, I, H);
                        }
                    } else if (hm2 & x) {
                        int L = l[16], H = L >> 4;
                        int E = s->filter.mblim_lut[L];
                        int I = s->filter.lim_lut[L];
                        s->dsp.loop_filter_8[!!(hmask2[1] & x)]
                                            [0](ptr + 8 * ls_uv, ls_uv, E, I, H);
                    }
                }
                if (x & 0xAA)
                    l += 2;
            }
        }
        lvl = lflvl->level;
        dst = f->data[1 + p] + uvoff;
        for (y = 0; y < 8; y++, dst += 4 * ls_uv) {
            uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[1][1][y];
            unsigned vm = vmask[0] | vmask[1] | vmask[2];
            for (x = 1; vm & ~(x - 1); x <<= 4, ptr += 16, l += 4) {
                if (row || y) {
                    if (vm & x) {
                        int L = *l, H = L >> 4;
                        int E = s->filter.mblim_lut[L];
                        int I = s->filter.lim_lut[L];
                        if (vmask[0] & x) {
                            if (vmask[0] & (x << 2)) {
                                av_assert2(l[2] == L);
                                s->dsp.loop_filter_16[1](ptr, ls_uv, E, I, H);
                            } else {
                                s->dsp.loop_filter_8[2][1](ptr, ls_uv, E, I, H);
                            }
                        } else if (vm & (x << 2)) {
                            L  = l[2];
                            H |= (L >> 4) << 8;
                            E |= s->filter.mblim_lut[L] << 8;
                            I |= s->filter.lim_lut[L] << 8;
                            s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]
                                                   [!!(vmask[1] & (x << 2))]
                                                   [1](ptr, ls_uv, E, I, H);
                        } else {
                            s->dsp.loop_filter_8[!!(vmask[1] & x)]
                                                [1](ptr, ls_uv, E, I, H);
                        }
                    } else if (vm & (x << 2)) {
                        int L = l[2], H = L >> 4;
                        int E = s->filter.mblim_lut[L];
                        int I = s->filter.lim_lut[L];
                        s->dsp.loop_filter_8[!!(vmask[1] & (x << 2))]
                                            [1](ptr + 8, ls_uv, E, I, H);
                    }
                }
            }
            if (y & 1)
                lvl += 16;
        }
    }
}
['static void loopfilter_subblock(AVCodecContext *avctx, VP9Filter *lflvl,\n                                int row, int col,\n                                ptrdiff_t yoff, ptrdiff_t uvoff)\n{\n    VP9Context *s = avctx->priv_data;\n    AVFrame    *f = s->frames[CUR_FRAME].tf.f;\n    uint8_t *dst   = f->data[0] + yoff;\n    ptrdiff_t ls_y = f->linesize[0], ls_uv = f->linesize[1];\n    uint8_t *lvl = lflvl->level;\n    int y, x, p;\n    for (y = 0; y < 8; y += 2, dst += 16 * ls_y, lvl += 16) {\n        uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[0][0][y];\n        uint8_t *hmask2 = lflvl->mask[0][0][y + 1];\n        unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];\n        unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];\n        unsigned hm  = hm1 | hm2 | hm13 | hm23;\n        for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8, l++) {\n            if (hm1 & x) {\n                int L = *l, H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                if (col || x > 1) {\n                    if (hmask1[0] & x) {\n                        if (hmask2[0] & x) {\n                            av_assert2(l[8] == L);\n                            s->dsp.loop_filter_16[0](ptr, ls_y, E, I, H);\n                        } else {\n                            s->dsp.loop_filter_8[2][0](ptr, ls_y, E, I, H);\n                        }\n                    } else if (hm2 & x) {\n                        L  = l[8];\n                        H |= (L >> 4) << 8;\n                        E |= s->filter.mblim_lut[L] << 8;\n                        I |= s->filter.lim_lut[L] << 8;\n                        s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]\n                                               [!!(hmask2[1] & x)]\n                                               [0](ptr, ls_y, E, I, H);\n                    } else {\n                        s->dsp.loop_filter_8[!!(hmask1[1] & x)]\n                                            [0](ptr, ls_y, E, I, H);\n                    }\n                }\n            } else if (hm2 & x) {\n                int L = l[8], H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                if (col || x > 1) {\n                    s->dsp.loop_filter_8[!!(hmask2[1] & x)]\n                                        [0](ptr + 8 * ls_y, ls_y, E, I, H);\n                }\n            }\n            if (hm13 & x) {\n                int L = *l, H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                if (hm23 & x) {\n                    L  = l[8];\n                    H |= (L >> 4) << 8;\n                    E |= s->filter.mblim_lut[L] << 8;\n                    I |= s->filter.lim_lut[L] << 8;\n                    s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls_y, E, I, H);\n                } else {\n                    s->dsp.loop_filter_8[0][0](ptr + 4, ls_y, E, I, H);\n                }\n            } else if (hm23 & x) {\n                int L = l[8], H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                s->dsp.loop_filter_8[0][0](ptr + 8 * ls_y + 4, ls_y, E, I, H);\n            }\n        }\n    }\n    dst = f->data[0] + yoff;\n    lvl = lflvl->level;\n    for (y = 0; y < 8; y++, dst += 8 * ls_y, lvl += 8) {\n        uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[0][1][y];\n        unsigned vm = vmask[0] | vmask[1] | vmask[2], vm3 = vmask[3];\n        for (x = 1; vm & ~(x - 1); x <<= 2, ptr += 16, l += 2) {\n            if (row || y) {\n                if (vm & x) {\n                    int L = *l, H = L >> 4;\n                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                    if (vmask[0] & x) {\n                        if (vmask[0] & (x << 1)) {\n                            av_assert2(l[1] == L);\n                            s->dsp.loop_filter_16[1](ptr, ls_y, E, I, H);\n                        } else {\n                            s->dsp.loop_filter_8[2][1](ptr, ls_y, E, I, H);\n                        }\n                    } else if (vm & (x << 1)) {\n                        L  = l[1];\n                        H |= (L >> 4) << 8;\n                        E |= s->filter.mblim_lut[L] << 8;\n                        I |= s->filter.lim_lut[L] << 8;\n                        s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]\n                                               [!!(vmask[1] & (x << 1))]\n                                               [1](ptr, ls_y, E, I, H);\n                    } else {\n                        s->dsp.loop_filter_8[!!(vmask[1] & x)]\n                                            [1](ptr, ls_y, E, I, H);\n                    }\n                } else if (vm & (x << 1)) {\n                    int L = l[1], H = L >> 4;\n                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                    s->dsp.loop_filter_8[!!(vmask[1] & (x << 1))]\n                                        [1](ptr + 8, ls_y, E, I, H);\n                }\n            }\n            if (vm3 & x) {\n                int L = *l, H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                if (vm3 & (x << 1)) {\n                    L  = l[1];\n                    H |= (L >> 4) << 8;\n                    E |= s->filter.mblim_lut[L] << 8;\n                    I |= s->filter.lim_lut[L] << 8;\n                    s->dsp.loop_filter_mix2[0][0][1](ptr + ls_y * 4, ls_y, E, I, H);\n                } else {\n                    s->dsp.loop_filter_8[0][1](ptr + ls_y * 4, ls_y, E, I, H);\n                }\n            } else if (vm3 & (x << 1)) {\n                int L = l[1], H = L >> 4;\n                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];\n                s->dsp.loop_filter_8[0][1](ptr + ls_y * 4 + 8, ls_y, E, I, H);\n            }\n        }\n    }\n    for (p = 0; p < 2; p++) {\n        lvl = lflvl->level;\n        dst = f->data[1 + p] + uvoff;\n        for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {\n            uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];\n            uint8_t *hmask2 = lflvl->mask[1][0][y + 2];\n            unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2];\n            unsigned hm2 = hmask2[1] | hmask2[2], hm = hm1 | hm2;\n            for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 4) {\n                if (col || x > 1) {\n                    if (hm1 & x) {\n                        int L = *l, H = L >> 4;\n                        int E = s->filter.mblim_lut[L];\n                        int I = s->filter.lim_lut[L];\n                        if (hmask1[0] & x) {\n                            if (hmask2[0] & x) {\n                                av_assert2(l[16] == L);\n                                s->dsp.loop_filter_16[0](ptr, ls_uv, E, I, H);\n                            } else {\n                                s->dsp.loop_filter_8[2][0](ptr, ls_uv, E, I, H);\n                            }\n                        } else if (hm2 & x) {\n                            L  = l[16];\n                            H |= (L >> 4) << 8;\n                            E |= s->filter.mblim_lut[L] << 8;\n                            I |= s->filter.lim_lut[L] << 8;\n                            s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]\n                                                   [!!(hmask2[1] & x)]\n                                                   [0](ptr, ls_uv, E, I, H);\n                        } else {\n                            s->dsp.loop_filter_8[!!(hmask1[1] & x)]\n                                                [0](ptr, ls_uv, E, I, H);\n                        }\n                    } else if (hm2 & x) {\n                        int L = l[16], H = L >> 4;\n                        int E = s->filter.mblim_lut[L];\n                        int I = s->filter.lim_lut[L];\n                        s->dsp.loop_filter_8[!!(hmask2[1] & x)]\n                                            [0](ptr + 8 * ls_uv, ls_uv, E, I, H);\n                    }\n                }\n                if (x & 0xAA)\n                    l += 2;\n            }\n        }\n        lvl = lflvl->level;\n        dst = f->data[1 + p] + uvoff;\n        for (y = 0; y < 8; y++, dst += 4 * ls_uv) {\n            uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[1][1][y];\n            unsigned vm = vmask[0] | vmask[1] | vmask[2];\n            for (x = 1; vm & ~(x - 1); x <<= 4, ptr += 16, l += 4) {\n                if (row || y) {\n                    if (vm & x) {\n                        int L = *l, H = L >> 4;\n                        int E = s->filter.mblim_lut[L];\n                        int I = s->filter.lim_lut[L];\n                        if (vmask[0] & x) {\n                            if (vmask[0] & (x << 2)) {\n                                av_assert2(l[2] == L);\n                                s->dsp.loop_filter_16[1](ptr, ls_uv, E, I, H);\n                            } else {\n                                s->dsp.loop_filter_8[2][1](ptr, ls_uv, E, I, H);\n                            }\n                        } else if (vm & (x << 2)) {\n                            L  = l[2];\n                            H |= (L >> 4) << 8;\n                            E |= s->filter.mblim_lut[L] << 8;\n                            I |= s->filter.lim_lut[L] << 8;\n                            s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]\n                                                   [!!(vmask[1] & (x << 2))]\n                                                   [1](ptr, ls_uv, E, I, H);\n                        } else {\n                            s->dsp.loop_filter_8[!!(vmask[1] & x)]\n                                                [1](ptr, ls_uv, E, I, H);\n                        }\n                    } else if (vm & (x << 2)) {\n                        int L = l[2], H = L >> 4;\n                        int E = s->filter.mblim_lut[L];\n                        int I = s->filter.lim_lut[L];\n                        s->dsp.loop_filter_8[!!(vmask[1] & (x << 2))]\n                                            [1](ptr + 8, ls_uv, E, I, H);\n                    }\n                }\n            }\n            if (y & 1)\n                lvl += 16;\n        }\n    }\n}']