libavcodec/intrax8.c:618: error: Buffer Overrun L2
  Offset: [0, 3] Size: 3.

libavcodec/intrax8.c:571:1: <Offset trace>
569. };
570. 
571. static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
     ^
572. {
573.     uint8_t *scantable;

libavcodec/intrax8.c:571:1: Parameter `w->orient`
569. };
570. 
571. static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
     ^
572. {
573.     uint8_t *scantable;

libavcodec/intrax8.c:571:1: <Length trace>
569. };
570. 
571. static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
     ^
572. {
573.     uint8_t *scantable;

libavcodec/intrax8.c:571:1: Parameter `w->scantable[*]`
569. };
570. 
571. static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
     ^
572. {
573.     uint8_t *scantable;

libavcodec/intrax8.c:618:9: Array access: Offset: [0, 3] Size: 3
616.         /* scantable_selector[12] = { 0, 2, 0, 1, 1, 1, 0, 2, 2, 0, 1, 2 }; <-
617.          * -> 10'01' 00'10' 10'00' 01'01' 01'00' 10'00 => 0x928548 */
618.         scantable = w->scantable[(0x928548 >> (2 * w->orient)) & 3].permutated;
             ^
619.         pos       = 0;
620.         do {

static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
{
    uint8_t *scantable;
    int final, run, level;
    int ac_mode, dc_mode, est_run, dc_level;
    int pos, n;
    int zeros_only;
    int use_quant_matrix;
    int sign;
    assert(w->orient < 12);
    w->bdsp.clear_block(w->block[0]);
    if (chroma)
        dc_mode = 2;
    else
        dc_mode = !!w->est_run;
    if (x8_get_dc_rlf(w, dc_mode, &dc_level, &final))
        return -1;
    n          = 0;
    zeros_only = 0;
    if (!final) {
        use_quant_matrix = w->use_quant_matrix;
        if (chroma) {
            ac_mode = 1;
            est_run = 64;
        } else {
            if (w->raw_orient < 3)
                use_quant_matrix = 0;
            if (w->raw_orient > 4) {
                ac_mode = 0;
                est_run = 64;
            } else {
                if (w->est_run > 1) {
                    ac_mode = 2;
                    est_run = w->est_run;
                } else {
                    ac_mode = 3;
                    est_run = 64;
                }
            }
        }
        x8_select_ac_table(w, ac_mode);
        scantable = w->scantable[(0x928548 >> (2 * w->orient)) & 3].permutated;
        pos       = 0;
        do {
            n++;
            if (n >= est_run) {
                ac_mode = 3;
                x8_select_ac_table(w, 3);
            }
            x8_get_ac_rlf(w, ac_mode, &run, &level, &final);
            pos += run + 1;
            if (pos > 63) {
                return -1;
            }
            level  = (level + 1) * w->dquant;
            level += w->qsum;
            sign  = -get_bits1(w->gb);
            level = (level ^ sign) - sign;
            if (use_quant_matrix)
                level = (level * quant_table[pos]) >> 8;
            w->block[0][scantable[pos]] = level;
        } while (!final);
        w->block_last_index[0] = pos;
    } else {
        w->block_last_index[0] = 0;
        if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) {
            int32_t divide_quant = !chroma ? w->divide_quant_dc_luma
                                           : w->divide_quant_dc_chroma;
            int32_t dc_quant     = !chroma ? w->quant
                                           : w->quant_dc_chroma;
            dc_level += (w->predicted_dc * divide_quant + (1 << 12)) >> 13;
            dsp_x8_put_solidcolor(av_clip_uint8((dc_level * dc_quant + 4) >> 3),
                                  w->dest[chroma],
                                  w->frame->linesize[!!chroma]);
            goto block_placed;
        }
        zeros_only = dc_level == 0;
    }
    if (!chroma)
        w->block[0][0] = dc_level * w->quant;
    else
        w->block[0][0] = dc_level * w->quant_dc_chroma;
    if ((unsigned int) (dc_level + 1) >= 3 && (w->edges & 3) != 3) {
        int direction;
        direction = (0x6A017C >> (w->orient * 2)) & 3;
        if (direction != 3) {
            x8_ac_compensation(w, direction, w->block[0][0]);
        }
    }
    if (w->flat_dc) {
        dsp_x8_put_solidcolor(w->predicted_dc, w->dest[chroma],
                              w->frame->linesize[!!chroma]);
    } else {
        w->dsp.spatial_compensation[w->orient](w->scratchpad,
                                               w->dest[chroma],
                                               w->frame->linesize[!!chroma]);
    }
    if (!zeros_only)
        w->idsp.idct_add(w->dest[chroma],
                         w->frame->linesize[!!chroma],
                         w->block[0]);
block_placed:
    if (!chroma)
        x8_update_predictions(w, w->orient, n);
    if (w->loopfilter) {
        uint8_t *ptr = w->dest[chroma];
        int linesize = w->frame->linesize[!!chroma];
        if (!((w->edges & 2) || (zeros_only && (w->orient | 4) == 4)))
            w->dsp.h_loop_filter(ptr, linesize, w->quant);
        if (!((w->edges & 1) || (zeros_only && (w->orient | 8) == 8)))
            w->dsp.v_loop_filter(ptr, linesize, w->quant);
    }
    return 0;
}
['static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)\n{\n    uint8_t *scantable;\n    int final, run, level;\n    int ac_mode, dc_mode, est_run, dc_level;\n    int pos, n;\n    int zeros_only;\n    int use_quant_matrix;\n    int sign;\n    assert(w->orient < 12);\n    w->bdsp.clear_block(w->block[0]);\n    if (chroma)\n        dc_mode = 2;\n    else\n        dc_mode = !!w->est_run;\n    if (x8_get_dc_rlf(w, dc_mode, &dc_level, &final))\n        return -1;\n    n          = 0;\n    zeros_only = 0;\n    if (!final) {\n        use_quant_matrix = w->use_quant_matrix;\n        if (chroma) {\n            ac_mode = 1;\n            est_run = 64;\n        } else {\n            if (w->raw_orient < 3)\n                use_quant_matrix = 0;\n            if (w->raw_orient > 4) {\n                ac_mode = 0;\n                est_run = 64;\n            } else {\n                if (w->est_run > 1) {\n                    ac_mode = 2;\n                    est_run = w->est_run;\n                } else {\n                    ac_mode = 3;\n                    est_run = 64;\n                }\n            }\n        }\n        x8_select_ac_table(w, ac_mode);\n        scantable = w->scantable[(0x928548 >> (2 * w->orient)) & 3].permutated;\n        pos       = 0;\n        do {\n            n++;\n            if (n >= est_run) {\n                ac_mode = 3;\n                x8_select_ac_table(w, 3);\n            }\n            x8_get_ac_rlf(w, ac_mode, &run, &level, &final);\n            pos += run + 1;\n            if (pos > 63) {\n                return -1;\n            }\n            level  = (level + 1) * w->dquant;\n            level += w->qsum;\n            sign  = -get_bits1(w->gb);\n            level = (level ^ sign) - sign;\n            if (use_quant_matrix)\n                level = (level * quant_table[pos]) >> 8;\n            w->block[0][scantable[pos]] = level;\n        } while (!final);\n        w->block_last_index[0] = pos;\n    } else {\n        w->block_last_index[0] = 0;\n        if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) {\n            int32_t divide_quant = !chroma ? w->divide_quant_dc_luma\n                                           : w->divide_quant_dc_chroma;\n            int32_t dc_quant     = !chroma ? w->quant\n                                           : w->quant_dc_chroma;\n            dc_level += (w->predicted_dc * divide_quant + (1 << 12)) >> 13;\n            dsp_x8_put_solidcolor(av_clip_uint8((dc_level * dc_quant + 4) >> 3),\n                                  w->dest[chroma],\n                                  w->frame->linesize[!!chroma]);\n            goto block_placed;\n        }\n        zeros_only = dc_level == 0;\n    }\n    if (!chroma)\n        w->block[0][0] = dc_level * w->quant;\n    else\n        w->block[0][0] = dc_level * w->quant_dc_chroma;\n    if ((unsigned int) (dc_level + 1) >= 3 && (w->edges & 3) != 3) {\n        int direction;\n        direction = (0x6A017C >> (w->orient * 2)) & 3;\n        if (direction != 3) {\n            x8_ac_compensation(w, direction, w->block[0][0]);\n        }\n    }\n    if (w->flat_dc) {\n        dsp_x8_put_solidcolor(w->predicted_dc, w->dest[chroma],\n                              w->frame->linesize[!!chroma]);\n    } else {\n        w->dsp.spatial_compensation[w->orient](w->scratchpad,\n                                               w->dest[chroma],\n                                               w->frame->linesize[!!chroma]);\n    }\n    if (!zeros_only)\n        w->idsp.idct_add(w->dest[chroma],\n                         w->frame->linesize[!!chroma],\n                         w->block[0]);\nblock_placed:\n    if (!chroma)\n        x8_update_predictions(w, w->orient, n);\n    if (w->loopfilter) {\n        uint8_t *ptr = w->dest[chroma];\n        int linesize = w->frame->linesize[!!chroma];\n        if (!((w->edges & 2) || (zeros_only && (w->orient | 4) == 4)))\n            w->dsp.h_loop_filter(ptr, linesize, w->quant);\n        if (!((w->edges & 1) || (zeros_only && (w->orient | 8) == 8)))\n            w->dsp.v_loop_filter(ptr, linesize, w->quant);\n    }\n    return 0;\n}']