libavcodec/mss4.c:309: error: Buffer Overrun L2
  Offset: [3, 4] (⇐ [2, 3] + 1) Size: 4 by call to `mss4_decode_dct`.

libavcodec/mss4.c:282:1: Parameter `c->dc_cache[*]`
280. }
281. 
282. static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb,
     ^
283.                                  uint8_t *dst[3], int mb_x, int mb_y)
284. {

libavcodec/mss4.c:309:15: Call
307.         c->dc_cache[i + 1][TOP_LEFT] = c->dc_cache[i + 1][TOP];
308.         c->dc_cache[i + 1][TOP]      = c->prev_dc[i][mb_x];
309.         ret = mss4_decode_dct(gb, c->dc_vlc + 1, c->ac_vlc + 1,
                   ^
310.                               c->block, c->dc_cache[i + 1], mb_x, mb_y,
311.                               c->quant_mat[1]);

libavcodec/mss4.c:227:1: <Length trace>
225. }
226. 
227. static int mss4_decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc,
     ^
228.                            int *block, int *dc_cache,
229.                            int bx, int by, uint16_t *quant_mat)

libavcodec/mss4.c:227:1: Parameter `*dc_cache`
  225. }
  226. 
  227. static int mss4_decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc,
       ^
  228.                            int *block, int *dc_cache,
  229.                            int bx, int by, uint16_t *quant_mat)

libavcodec/mss4.c:242:18: Array access: Offset: [3, 4] (⇐ [2, 3] + 1) Size: 4 by call to `mss4_decode_dct` 
  240. 
  241.             l  = dc_cache[LEFT];
  242.             tl = dc_cache[TOP_LEFT];
                        ^
  243.             t  = dc_cache[TOP];
  244. 

static int mss4_decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc,
                           int *block, int *dc_cache,
                           int bx, int by, uint16_t *quant_mat)
{
    int skip, val, pos = 1, zz_pos, dc;
    memset(block, 0, sizeof(*block) * 64);
    dc = get_coeff(gb, dc_vlc);
    if (by) {
        if (bx) {
            int l, tl, t;
            l  = dc_cache[LEFT];
            tl = dc_cache[TOP_LEFT];
            t  = dc_cache[TOP];
            if (FFABS(t - tl) <= FFABS(l - tl))
                dc += l;
            else
                dc += t;
        } else {
            dc += dc_cache[TOP];
        }
    } else if (bx) {
        dc += dc_cache[LEFT];
    }
    dc_cache[LEFT] = dc;
    block[0]       = dc * quant_mat[0];
    while (pos < 64) {
        val = get_vlc2(gb, ac_vlc->table, 9, 2);
        if (!val)
            return 0;
        if (val == -1)
            return -1;
        if (val == 0xF0) {
            pos += 16;
            continue;
        }
        skip = val >> 4;
        val  = get_coeff_bits(gb, val & 0xF);
        pos += skip;
        if (pos >= 64)
            return -1;
        zz_pos = ff_zigzag_direct[pos];
        block[zz_pos] = val * quant_mat[zz_pos];
        pos++;
    }
    return pos == 64 ? 0 : -1;
}
['static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb,\n                                 uint8_t *dst[3], int mb_x, int mb_y)\n{\n    int i, j, k, ret;\n    uint8_t *out = dst[0];\n    for (j = 0; j < 2; j++) {\n        for (i = 0; i < 2; i++) {\n            int xpos = mb_x * 2 + i;\n            c->dc_cache[j][TOP_LEFT] = c->dc_cache[j][TOP];\n            c->dc_cache[j][TOP]      = c->prev_dc[0][mb_x * 2 + i];\n            ret = mss4_decode_dct(gb, c->dc_vlc, c->ac_vlc, c->block,\n                                  c->dc_cache[j],\n                                  xpos, mb_y * 2 + j, c->quant_mat[0]);\n            if (ret)\n                return ret;\n            c->prev_dc[0][mb_x * 2 + i] = c->dc_cache[j][LEFT];\n            ff_mss34_dct_put(out + xpos * 8, c->pic.linesize[0],\n                             c->block);\n        }\n        out += 8 * c->pic.linesize[0];\n    }\n    for (i = 1; i < 3; i++) {\n        c->dc_cache[i + 1][TOP_LEFT] = c->dc_cache[i + 1][TOP];\n        c->dc_cache[i + 1][TOP]      = c->prev_dc[i][mb_x];\n        ret = mss4_decode_dct(gb, c->dc_vlc + 1, c->ac_vlc + 1,\n                              c->block, c->dc_cache[i + 1], mb_x, mb_y,\n                              c->quant_mat[1]);\n        if (ret)\n            return ret;\n        c->prev_dc[i][mb_x] = c->dc_cache[i + 1][LEFT];\n        ff_mss34_dct_put(c->imgbuf[i], 8, c->block);\n        out = dst[i] + mb_x * 16;\n        for (j = 0; j < 16; j++) {\n            for (k = 0; k < 8; k++)\n                AV_WN16A(out + k * 2, c->imgbuf[i][k + (j & ~1) * 4] * 0x101);\n            out += c->pic.linesize[i];\n        }\n    }\n    return 0;\n}', 'static int mss4_decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc,\n                           int *block, int *dc_cache,\n                           int bx, int by, uint16_t *quant_mat)\n{\n    int skip, val, pos = 1, zz_pos, dc;\n    memset(block, 0, sizeof(*block) * 64);\n    dc = get_coeff(gb, dc_vlc);\n    if (by) {\n        if (bx) {\n            int l, tl, t;\n            l  = dc_cache[LEFT];\n            tl = dc_cache[TOP_LEFT];\n            t  = dc_cache[TOP];\n            if (FFABS(t - tl) <= FFABS(l - tl))\n                dc += l;\n            else\n                dc += t;\n        } else {\n            dc += dc_cache[TOP];\n        }\n    } else if (bx) {\n        dc += dc_cache[LEFT];\n    }\n    dc_cache[LEFT] = dc;\n    block[0]       = dc * quant_mat[0];\n    while (pos < 64) {\n        val = get_vlc2(gb, ac_vlc->table, 9, 2);\n        if (!val)\n            return 0;\n        if (val == -1)\n            return -1;\n        if (val == 0xF0) {\n            pos += 16;\n            continue;\n        }\n        skip = val >> 4;\n        val  = get_coeff_bits(gb, val & 0xF);\n        pos += skip;\n        if (pos >= 64)\n            return -1;\n        zz_pos = ff_zigzag_direct[pos];\n        block[zz_pos] = val * quant_mat[zz_pos];\n        pos++;\n    }\n    return pos == 64 ? 0 : -1;\n}']