libavcodec/vp9prob.c:130: error: Buffer Overrun L2
  Offset: [1, 2] (⇐ [0, 1] + 1) Size: 2.

libavcodec/vp9prob.c:46:1: <Length trace>
44. }
45. 
46. void ff_vp9_adapt_probs(VP9Context *s)
    ^
47. {
48.     int i, j, k, l, m;

libavcodec/vp9prob.c:46:1: Parameter `s->counts.tx16p[*]`
44. }
45. 
46. void ff_vp9_adapt_probs(VP9Context *s)
    ^
47. {
48.     int i, j, k, l, m;

libavcodec/vp9prob.c:126:13: Assignment
124.     if (s->txfmmode == TX_SWITCHABLE) {
125.         for (i = 0; i < 2; i++) {
126.             unsigned *c16 = s->counts.tx16p[i], *c32 = s->counts.tx32p[i];
                 ^
127. 
128.             adapt_prob(&p->tx8p[i], s->counts.tx8p[i][0],

libavcodec/vp9prob.c:130:49: Array access: Offset: [1, 2] (⇐ [0, 1] + 1) Size: 2
128.             adapt_prob(&p->tx8p[i], s->counts.tx8p[i][0],
129.                        s->counts.tx8p[i][1], 20, 128);
130.             adapt_prob(&p->tx16p[i][0], c16[0], c16[1] + c16[2], 20, 128);
                                                     ^
131.             adapt_prob(&p->tx16p[i][1], c16[1], c16[2], 20, 128);
132.             adapt_prob(&p->tx32p[i][0], c32[0], c32[1] + c32[2] + c32[3], 20, 128);

void ff_vp9_adapt_probs(VP9Context *s)
{
    int i, j, k, l, m;
    ProbContext *p = &s->prob_ctx[s->framectxid].p;
    int uf = (s->keyframe || s->intraonly || !s->last_keyframe) ? 112 : 128;
    for (i = 0; i < 4; i++)
        for (j = 0; j < 2; j++)
            for (k = 0; k < 2; k++)
                for (l = 0; l < 6; l++)
                    for (m = 0; m < 6; m++) {
                        uint8_t *pp = s->prob_ctx[s->framectxid].coef[i][j][k][l][m];
                        unsigned *e = s->counts.eob[i][j][k][l][m];
                        unsigned *c = s->counts.coef[i][j][k][l][m];
                        if (l == 0 && m >= 3)
                            break;
                        adapt_prob(&pp[0], e[0], e[1], 24, uf);
                        adapt_prob(&pp[1], c[0], c[1] + c[2], 24, uf);
                        adapt_prob(&pp[2], c[1], c[2], 24, uf);
                    }
    if (s->keyframe || s->intraonly) {
        memcpy(p->skip,  s->prob.p.skip,  sizeof(p->skip));
        memcpy(p->tx32p, s->prob.p.tx32p, sizeof(p->tx32p));
        memcpy(p->tx16p, s->prob.p.tx16p, sizeof(p->tx16p));
        memcpy(p->tx8p,  s->prob.p.tx8p,  sizeof(p->tx8p));
        return;
    }
    for (i = 0; i < 3; i++)
        adapt_prob(&p->skip[i], s->counts.skip[i][0],
                   s->counts.skip[i][1], 20, 128);
    for (i = 0; i < 4; i++)
        adapt_prob(&p->intra[i], s->counts.intra[i][0],
                   s->counts.intra[i][1], 20, 128);
    if (s->comppredmode == PRED_SWITCHABLE) {
        for (i = 0; i < 5; i++)
            adapt_prob(&p->comp[i], s->counts.comp[i][0],
                       s->counts.comp[i][1], 20, 128);
    }
    if (s->comppredmode != PRED_SINGLEREF) {
        for (i = 0; i < 5; i++)
            adapt_prob(&p->comp_ref[i], s->counts.comp_ref[i][0],
                       s->counts.comp_ref[i][1], 20, 128);
    }
    if (s->comppredmode != PRED_COMPREF) {
        for (i = 0; i < 5; i++) {
            uint8_t *pp = p->single_ref[i];
            unsigned (*c)[2] = s->counts.single_ref[i];
            adapt_prob(&pp[0], c[0][0], c[0][1], 20, 128);
            adapt_prob(&pp[1], c[1][0], c[1][1], 20, 128);
        }
    }
    for (i = 0; i < 4; i++)
        for (j = 0; j < 4; j++) {
            uint8_t *pp = p->partition[i][j];
            unsigned *c = s->counts.partition[i][j];
            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
            adapt_prob(&pp[2], c[2], c[3], 20, 128);
        }
    if (s->txfmmode == TX_SWITCHABLE) {
        for (i = 0; i < 2; i++) {
            unsigned *c16 = s->counts.tx16p[i], *c32 = s->counts.tx32p[i];
            adapt_prob(&p->tx8p[i], s->counts.tx8p[i][0],
                       s->counts.tx8p[i][1], 20, 128);
            adapt_prob(&p->tx16p[i][0], c16[0], c16[1] + c16[2], 20, 128);
            adapt_prob(&p->tx16p[i][1], c16[1], c16[2], 20, 128);
            adapt_prob(&p->tx32p[i][0], c32[0], c32[1] + c32[2] + c32[3], 20, 128);
            adapt_prob(&p->tx32p[i][1], c32[1], c32[2] + c32[3], 20, 128);
            adapt_prob(&p->tx32p[i][2], c32[2], c32[3], 20, 128);
        }
    }
    if (s->filtermode == FILTER_SWITCHABLE) {
        for (i = 0; i < 4; i++) {
            uint8_t *pp = p->filter[i];
            unsigned *c = s->counts.filter[i];
            adapt_prob(&pp[0], c[0], c[1] + c[2], 20, 128);
            adapt_prob(&pp[1], c[1], c[2], 20, 128);
        }
    }
    for (i = 0; i < 7; i++) {
        uint8_t *pp = p->mv_mode[i];
        unsigned *c = s->counts.mv_mode[i];
        adapt_prob(&pp[0], c[2], c[1] + c[0] + c[3], 20, 128);
        adapt_prob(&pp[1], c[0], c[1] + c[3], 20, 128);
        adapt_prob(&pp[2], c[1], c[3], 20, 128);
    }
    {
        uint8_t *pp = p->mv_joint;
        unsigned *c = s->counts.mv_joint;
        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
        adapt_prob(&pp[2], c[2], c[3], 20, 128);
    }
    for (i = 0; i < 2; i++) {
        uint8_t *pp;
        unsigned *c, (*c2)[2], sum;
        adapt_prob(&p->mv_comp[i].sign, s->counts.mv_comp[i].sign[0],
                   s->counts.mv_comp[i].sign[1], 20, 128);
        pp  = p->mv_comp[i].classes;
        c   = s->counts.mv_comp[i].classes;
        sum = c[1] + c[2] + c[3] + c[4] + c[5] +
              c[6] + c[7] + c[8] + c[9] + c[10];
        adapt_prob(&pp[0], c[0], sum, 20, 128);
        sum -= c[1];
        adapt_prob(&pp[1], c[1], sum, 20, 128);
        sum -= c[2] + c[3];
        adapt_prob(&pp[2], c[2] + c[3], sum, 20, 128);
        adapt_prob(&pp[3], c[2], c[3], 20, 128);
        sum -= c[4] + c[5];
        adapt_prob(&pp[4], c[4] + c[5], sum, 20, 128);
        adapt_prob(&pp[5], c[4], c[5], 20, 128);
        sum -= c[6];
        adapt_prob(&pp[6], c[6], sum, 20, 128);
        adapt_prob(&pp[7], c[7] + c[8], c[9] + c[10], 20, 128);
        adapt_prob(&pp[8], c[7], c[8], 20, 128);
        adapt_prob(&pp[9], c[9], c[10], 20, 128);
        adapt_prob(&p->mv_comp[i].class0, s->counts.mv_comp[i].class0[0],
                   s->counts.mv_comp[i].class0[1], 20, 128);
        pp = p->mv_comp[i].bits;
        c2 = s->counts.mv_comp[i].bits;
        for (j = 0; j < 10; j++)
            adapt_prob(&pp[j], c2[j][0], c2[j][1], 20, 128);
        for (j = 0; j < 2; j++) {
            pp = p->mv_comp[i].class0_fp[j];
            c  = s->counts.mv_comp[i].class0_fp[j];
            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
            adapt_prob(&pp[2], c[2], c[3], 20, 128);
        }
        pp = p->mv_comp[i].fp;
        c  = s->counts.mv_comp[i].fp;
        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
        adapt_prob(&pp[2], c[2], c[3], 20, 128);
        if (s->highprecisionmvs) {
            adapt_prob(&p->mv_comp[i].class0_hp,
                       s->counts.mv_comp[i].class0_hp[0],
                       s->counts.mv_comp[i].class0_hp[1], 20, 128);
            adapt_prob(&p->mv_comp[i].hp, s->counts.mv_comp[i].hp[0],
                       s->counts.mv_comp[i].hp[1], 20, 128);
        }
    }
    for (i = 0; i < 4; i++) {
        uint8_t *pp = p->y_mode[i];
        unsigned *c = s->counts.y_mode[i], sum, s2;
        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];
        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);
        sum -= c[TM_VP8_PRED];
        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);
        sum -= c[VERT_PRED];
        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);
        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];
        sum -= s2;
        adapt_prob(&pp[3], s2, sum, 20, 128);
        s2 -= c[HOR_PRED];
        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);
        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],
                   20, 128);
        sum -= c[DIAG_DOWN_LEFT_PRED];
        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);
        sum -= c[VERT_LEFT_PRED];
        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);
        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);
    }
    for (i = 0; i < 10; i++) {
        uint8_t *pp = p->uv_mode[i];
        unsigned *c = s->counts.uv_mode[i], sum, s2;
        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];
        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);
        sum -= c[TM_VP8_PRED];
        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);
        sum -= c[VERT_PRED];
        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);
        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];
        sum -= s2;
        adapt_prob(&pp[3], s2, sum, 20, 128);
        s2 -= c[HOR_PRED];
        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);
        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],
                   20, 128);
        sum -= c[DIAG_DOWN_LEFT_PRED];
        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);
        sum -= c[VERT_LEFT_PRED];
        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);
        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);
    }
}
['void ff_vp9_adapt_probs(VP9Context *s)\n{\n    int i, j, k, l, m;\n    ProbContext *p = &s->prob_ctx[s->framectxid].p;\n    int uf = (s->keyframe || s->intraonly || !s->last_keyframe) ? 112 : 128;\n    for (i = 0; i < 4; i++)\n        for (j = 0; j < 2; j++)\n            for (k = 0; k < 2; k++)\n                for (l = 0; l < 6; l++)\n                    for (m = 0; m < 6; m++) {\n                        uint8_t *pp = s->prob_ctx[s->framectxid].coef[i][j][k][l][m];\n                        unsigned *e = s->counts.eob[i][j][k][l][m];\n                        unsigned *c = s->counts.coef[i][j][k][l][m];\n                        if (l == 0 && m >= 3)\n                            break;\n                        adapt_prob(&pp[0], e[0], e[1], 24, uf);\n                        adapt_prob(&pp[1], c[0], c[1] + c[2], 24, uf);\n                        adapt_prob(&pp[2], c[1], c[2], 24, uf);\n                    }\n    if (s->keyframe || s->intraonly) {\n        memcpy(p->skip,  s->prob.p.skip,  sizeof(p->skip));\n        memcpy(p->tx32p, s->prob.p.tx32p, sizeof(p->tx32p));\n        memcpy(p->tx16p, s->prob.p.tx16p, sizeof(p->tx16p));\n        memcpy(p->tx8p,  s->prob.p.tx8p,  sizeof(p->tx8p));\n        return;\n    }\n    for (i = 0; i < 3; i++)\n        adapt_prob(&p->skip[i], s->counts.skip[i][0],\n                   s->counts.skip[i][1], 20, 128);\n    for (i = 0; i < 4; i++)\n        adapt_prob(&p->intra[i], s->counts.intra[i][0],\n                   s->counts.intra[i][1], 20, 128);\n    if (s->comppredmode == PRED_SWITCHABLE) {\n        for (i = 0; i < 5; i++)\n            adapt_prob(&p->comp[i], s->counts.comp[i][0],\n                       s->counts.comp[i][1], 20, 128);\n    }\n    if (s->comppredmode != PRED_SINGLEREF) {\n        for (i = 0; i < 5; i++)\n            adapt_prob(&p->comp_ref[i], s->counts.comp_ref[i][0],\n                       s->counts.comp_ref[i][1], 20, 128);\n    }\n    if (s->comppredmode != PRED_COMPREF) {\n        for (i = 0; i < 5; i++) {\n            uint8_t *pp = p->single_ref[i];\n            unsigned (*c)[2] = s->counts.single_ref[i];\n            adapt_prob(&pp[0], c[0][0], c[0][1], 20, 128);\n            adapt_prob(&pp[1], c[1][0], c[1][1], 20, 128);\n        }\n    }\n    for (i = 0; i < 4; i++)\n        for (j = 0; j < 4; j++) {\n            uint8_t *pp = p->partition[i][j];\n            unsigned *c = s->counts.partition[i][j];\n            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);\n            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);\n            adapt_prob(&pp[2], c[2], c[3], 20, 128);\n        }\n    if (s->txfmmode == TX_SWITCHABLE) {\n        for (i = 0; i < 2; i++) {\n            unsigned *c16 = s->counts.tx16p[i], *c32 = s->counts.tx32p[i];\n            adapt_prob(&p->tx8p[i], s->counts.tx8p[i][0],\n                       s->counts.tx8p[i][1], 20, 128);\n            adapt_prob(&p->tx16p[i][0], c16[0], c16[1] + c16[2], 20, 128);\n            adapt_prob(&p->tx16p[i][1], c16[1], c16[2], 20, 128);\n            adapt_prob(&p->tx32p[i][0], c32[0], c32[1] + c32[2] + c32[3], 20, 128);\n            adapt_prob(&p->tx32p[i][1], c32[1], c32[2] + c32[3], 20, 128);\n            adapt_prob(&p->tx32p[i][2], c32[2], c32[3], 20, 128);\n        }\n    }\n    if (s->filtermode == FILTER_SWITCHABLE) {\n        for (i = 0; i < 4; i++) {\n            uint8_t *pp = p->filter[i];\n            unsigned *c = s->counts.filter[i];\n            adapt_prob(&pp[0], c[0], c[1] + c[2], 20, 128);\n            adapt_prob(&pp[1], c[1], c[2], 20, 128);\n        }\n    }\n    for (i = 0; i < 7; i++) {\n        uint8_t *pp = p->mv_mode[i];\n        unsigned *c = s->counts.mv_mode[i];\n        adapt_prob(&pp[0], c[2], c[1] + c[0] + c[3], 20, 128);\n        adapt_prob(&pp[1], c[0], c[1] + c[3], 20, 128);\n        adapt_prob(&pp[2], c[1], c[3], 20, 128);\n    }\n    {\n        uint8_t *pp = p->mv_joint;\n        unsigned *c = s->counts.mv_joint;\n        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);\n        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);\n        adapt_prob(&pp[2], c[2], c[3], 20, 128);\n    }\n    for (i = 0; i < 2; i++) {\n        uint8_t *pp;\n        unsigned *c, (*c2)[2], sum;\n        adapt_prob(&p->mv_comp[i].sign, s->counts.mv_comp[i].sign[0],\n                   s->counts.mv_comp[i].sign[1], 20, 128);\n        pp  = p->mv_comp[i].classes;\n        c   = s->counts.mv_comp[i].classes;\n        sum = c[1] + c[2] + c[3] + c[4] + c[5] +\n              c[6] + c[7] + c[8] + c[9] + c[10];\n        adapt_prob(&pp[0], c[0], sum, 20, 128);\n        sum -= c[1];\n        adapt_prob(&pp[1], c[1], sum, 20, 128);\n        sum -= c[2] + c[3];\n        adapt_prob(&pp[2], c[2] + c[3], sum, 20, 128);\n        adapt_prob(&pp[3], c[2], c[3], 20, 128);\n        sum -= c[4] + c[5];\n        adapt_prob(&pp[4], c[4] + c[5], sum, 20, 128);\n        adapt_prob(&pp[5], c[4], c[5], 20, 128);\n        sum -= c[6];\n        adapt_prob(&pp[6], c[6], sum, 20, 128);\n        adapt_prob(&pp[7], c[7] + c[8], c[9] + c[10], 20, 128);\n        adapt_prob(&pp[8], c[7], c[8], 20, 128);\n        adapt_prob(&pp[9], c[9], c[10], 20, 128);\n        adapt_prob(&p->mv_comp[i].class0, s->counts.mv_comp[i].class0[0],\n                   s->counts.mv_comp[i].class0[1], 20, 128);\n        pp = p->mv_comp[i].bits;\n        c2 = s->counts.mv_comp[i].bits;\n        for (j = 0; j < 10; j++)\n            adapt_prob(&pp[j], c2[j][0], c2[j][1], 20, 128);\n        for (j = 0; j < 2; j++) {\n            pp = p->mv_comp[i].class0_fp[j];\n            c  = s->counts.mv_comp[i].class0_fp[j];\n            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);\n            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);\n            adapt_prob(&pp[2], c[2], c[3], 20, 128);\n        }\n        pp = p->mv_comp[i].fp;\n        c  = s->counts.mv_comp[i].fp;\n        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);\n        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);\n        adapt_prob(&pp[2], c[2], c[3], 20, 128);\n        if (s->highprecisionmvs) {\n            adapt_prob(&p->mv_comp[i].class0_hp,\n                       s->counts.mv_comp[i].class0_hp[0],\n                       s->counts.mv_comp[i].class0_hp[1], 20, 128);\n            adapt_prob(&p->mv_comp[i].hp, s->counts.mv_comp[i].hp[0],\n                       s->counts.mv_comp[i].hp[1], 20, 128);\n        }\n    }\n    for (i = 0; i < 4; i++) {\n        uint8_t *pp = p->y_mode[i];\n        unsigned *c = s->counts.y_mode[i], sum, s2;\n        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];\n        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);\n        sum -= c[TM_VP8_PRED];\n        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);\n        sum -= c[VERT_PRED];\n        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);\n        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];\n        sum -= s2;\n        adapt_prob(&pp[3], s2, sum, 20, 128);\n        s2 -= c[HOR_PRED];\n        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);\n        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],\n                   20, 128);\n        sum -= c[DIAG_DOWN_LEFT_PRED];\n        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);\n        sum -= c[VERT_LEFT_PRED];\n        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);\n        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);\n    }\n    for (i = 0; i < 10; i++) {\n        uint8_t *pp = p->uv_mode[i];\n        unsigned *c = s->counts.uv_mode[i], sum, s2;\n        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];\n        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);\n        sum -= c[TM_VP8_PRED];\n        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);\n        sum -= c[VERT_PRED];\n        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);\n        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];\n        sum -= s2;\n        adapt_prob(&pp[3], s2, sum, 20, 128);\n        s2 -= c[HOR_PRED];\n        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);\n        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],\n                   20, 128);\n        sum -= c[DIAG_DOWN_LEFT_PRED];\n        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);\n        sum -= c[VERT_LEFT_PRED];\n        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);\n        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);\n    }\n}']