libavcodec/proresenc.c:815: error: Buffer Overrun L1
  Offset: [64, `avctx->priv_data->num_planes` + 63] Size: 4 by call to `estimate_slice_plane`.

libavcodec/proresenc.c:747:1: Parameter `avctx->priv_data->num_planes`
745. }
746. 
747. static int find_slice_quant(AVCodecContext *avctx,
     ^
748.                             int trellis_node, int x, int y, int mbs_per_slice,
749.                             ProresThreadData *td)

libavcodec/proresenc.c:815:21: Call
813.         error = 0;
814.         for (i = 0; i < ctx->num_planes - !!ctx->alpha_bits; i++) {
815.             bits += estimate_slice_plane(ctx, &error, i,
                         ^
816.                                          src, linesize[i],
817.                                          mbs_per_slice,

libavcodec/proresenc.c:669:1: Parameter `plane`
  667. }
  668. 
  669. static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,
       ^
  670.                                 const uint16_t *src, int linesize,
  671.                                 int mbs_per_slice,

libavcodec/proresenc.c:680:13: Call
  678.     blocks_per_slice = mbs_per_slice * blocks_per_mb;
  679. 
  680.     bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);
                   ^
  681.     bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,
  682.                          plane_size_factor, ctx->scantable, qmat);

libavcodec/proresenc.c:602:1: <Length trace>
600. }
601. 
602. static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice,
     ^
603.                         int scale)
604. {

libavcodec/proresenc.c:602:1: Parameter `*blocks`
    600. }
    601. 
    602. static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice,
         ^
    603.                         int scale)
    604. {

libavcodec/proresenc.c:613:5: Assignment
    611.     sign     = 0;
    612.     codebook = 3;
    613.     blocks  += 64;
             ^
    614.     *error  += FFABS(blocks[0] - 0x4000) % scale;
    615. 

libavcodec/proresenc.c:614:16: Array access: Offset: [64, avctx->priv_data->num_planes + 63] Size: 4 by call to `estimate_slice_plane` 
    612.     codebook = 3;
    613.     blocks  += 64;
    614.     *error  += FFABS(blocks[0] - 0x4000) % scale;
                        ^
    615. 
    616.     for (i = 1; i < blocks_per_slice; i++, blocks += 64) {

static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice,
                        int scale)
{
    int i;
    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;
    int bits;
    prev_dc  = (blocks[0] - 0x4000) / scale;
    bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));
    sign     = 0;
    codebook = 3;
    blocks  += 64;
    *error  += FFABS(blocks[0] - 0x4000) % scale;
    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
        dc       = (blocks[0] - 0x4000) / scale;
        *error  += FFABS(blocks[0] - 0x4000) % scale;
        delta    = dc - prev_dc;
        new_sign = GET_SIGN(delta);
        delta    = (delta ^ sign) - sign;
        code     = MAKE_CODE(delta);
        bits    += estimate_vlc(ff_prores_dc_codebook[codebook], code);
        codebook = (code + (code & 1)) >> 1;
        codebook = FFMIN(codebook, 3);
        sign     = new_sign;
        prev_dc  = dc;
    }
    return bits;
}
['static int find_slice_quant(AVCodecContext *avctx,\n                            int trellis_node, int x, int y, int mbs_per_slice,\n                            ProresThreadData *td)\n{\n    ProresContext *ctx = avctx->priv_data;\n    int i, q, pq, xp, yp;\n    const uint16_t *src;\n    int slice_width_factor = av_log2(mbs_per_slice);\n    int num_cblocks[MAX_PLANES], pwidth;\n    int plane_factor[MAX_PLANES], is_chroma[MAX_PLANES];\n    const int min_quant = ctx->profile_info->min_quant;\n    const int max_quant = ctx->profile_info->max_quant;\n    int error, bits, bits_limit;\n    int mbs, prev, cur, new_score;\n    int slice_bits[TRELLIS_WIDTH], slice_score[TRELLIS_WIDTH];\n    int overquant;\n    uint16_t *qmat;\n    int linesize[4], line_add;\n    if (ctx->pictures_per_frame == 1)\n        line_add = 0;\n    else\n        line_add = ctx->cur_picture_idx ^ !ctx->pic->top_field_first;\n    mbs = x + mbs_per_slice;\n    for (i = 0; i < ctx->num_planes; i++) {\n        is_chroma[i]    = (i == 1 || i == 2);\n        plane_factor[i] = slice_width_factor + 2;\n        if (is_chroma[i])\n            plane_factor[i] += ctx->chroma_factor - 3;\n        if (!is_chroma[i] || ctx->chroma_factor == CFACTOR_Y444) {\n            xp             = x << 4;\n            yp             = y << 4;\n            num_cblocks[i] = 4;\n            pwidth         = avctx->width;\n        } else {\n            xp             = x << 3;\n            yp             = y << 4;\n            num_cblocks[i] = 2;\n            pwidth         = avctx->width >> 1;\n        }\n        linesize[i] = ctx->pic->linesize[i] * ctx->pictures_per_frame;\n        src = (const uint16_t *)(ctx->pic->data[i] + yp * linesize[i] +\n                                 line_add * ctx->pic->linesize[i]) + xp;\n        if (i < 3) {\n            get_slice_data(ctx, src, linesize[i], xp, yp,\n                           pwidth, avctx->height / ctx->pictures_per_frame,\n                           td->blocks[i], td->emu_buf,\n                           mbs_per_slice, num_cblocks[i], is_chroma[i]);\n        } else {\n            get_alpha_data(ctx, src, linesize[i], xp, yp,\n                           pwidth, avctx->height / ctx->pictures_per_frame,\n                           td->blocks[i], mbs_per_slice, ctx->alpha_bits);\n        }\n    }\n    for (q = min_quant; q < max_quant + 2; q++) {\n        td->nodes[trellis_node + q].prev_node = -1;\n        td->nodes[trellis_node + q].quant     = q;\n    }\n    for (q = min_quant; q <= max_quant; q++) {\n        bits  = 0;\n        error = 0;\n        for (i = 0; i < ctx->num_planes - !!ctx->alpha_bits; i++) {\n            bits += estimate_slice_plane(ctx, &error, i,\n                                         src, linesize[i],\n                                         mbs_per_slice,\n                                         num_cblocks[i], plane_factor[i],\n                                         ctx->quants[q], td);\n        }\n        if (ctx->alpha_bits)\n            bits += estimate_alpha_plane(ctx, &error, src, linesize[3],\n                                         mbs_per_slice, q, td->blocks[3]);\n        if (bits > 65000 * 8)\n            error = SCORE_LIMIT;\n        slice_bits[q]  = bits;\n        slice_score[q] = error;\n    }\n    if (slice_bits[max_quant] <= ctx->bits_per_mb * mbs_per_slice) {\n        slice_bits[max_quant + 1]  = slice_bits[max_quant];\n        slice_score[max_quant + 1] = slice_score[max_quant] + 1;\n        overquant = max_quant;\n    } else {\n        for (q = max_quant + 1; q < 128; q++) {\n            bits  = 0;\n            error = 0;\n            if (q < MAX_STORED_Q) {\n                qmat = ctx->quants[q];\n            } else {\n                qmat = td->custom_q;\n                for (i = 0; i < 64; i++)\n                    qmat[i] = ctx->quant_mat[i] * q;\n            }\n            for (i = 0; i < ctx->num_planes - !!ctx->alpha_bits; i++) {\n                bits += estimate_slice_plane(ctx, &error, i,\n                                             src, linesize[i],\n                                             mbs_per_slice,\n                                             num_cblocks[i], plane_factor[i],\n                                             qmat, td);\n            }\n            if (ctx->alpha_bits)\n                bits += estimate_alpha_plane(ctx, &error, src, linesize[3],\n                                             mbs_per_slice, q, td->blocks[3]);\n            if (bits <= ctx->bits_per_mb * mbs_per_slice)\n                break;\n        }\n        slice_bits[max_quant + 1]  = bits;\n        slice_score[max_quant + 1] = error;\n        overquant = q;\n    }\n    td->nodes[trellis_node + max_quant + 1].quant = overquant;\n    bits_limit = mbs * ctx->bits_per_mb;\n    for (pq = min_quant; pq < max_quant + 2; pq++) {\n        prev = trellis_node - TRELLIS_WIDTH + pq;\n        for (q = min_quant; q < max_quant + 2; q++) {\n            cur = trellis_node + q;\n            bits  = td->nodes[prev].bits + slice_bits[q];\n            error = slice_score[q];\n            if (bits > bits_limit)\n                error = SCORE_LIMIT;\n            if (td->nodes[prev].score < SCORE_LIMIT && error < SCORE_LIMIT)\n                new_score = td->nodes[prev].score + error;\n            else\n                new_score = SCORE_LIMIT;\n            if (td->nodes[cur].prev_node == -1 ||\n                td->nodes[cur].score >= new_score) {\n                td->nodes[cur].bits      = bits;\n                td->nodes[cur].score     = new_score;\n                td->nodes[cur].prev_node = prev;\n            }\n        }\n    }\n    error = td->nodes[trellis_node + min_quant].score;\n    pq    = trellis_node + min_quant;\n    for (q = min_quant + 1; q < max_quant + 2; q++) {\n        if (td->nodes[trellis_node + q].score <= error) {\n            error = td->nodes[trellis_node + q].score;\n            pq    = trellis_node + q;\n        }\n    }\n    return pq;\n}', 'static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,\n                                const uint16_t *src, int linesize,\n                                int mbs_per_slice,\n                                int blocks_per_mb, int plane_size_factor,\n                                const int16_t *qmat, ProresThreadData *td)\n{\n    int blocks_per_slice;\n    int bits;\n    blocks_per_slice = mbs_per_slice * blocks_per_mb;\n    bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);\n    bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,\n                         plane_size_factor, ctx->scantable, qmat);\n    return FFALIGN(bits, 8);\n}', 'static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice,\n                        int scale)\n{\n    int i;\n    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;\n    int bits;\n    prev_dc  = (blocks[0] - 0x4000) / scale;\n    bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));\n    sign     = 0;\n    codebook = 3;\n    blocks  += 64;\n    *error  += FFABS(blocks[0] - 0x4000) % scale;\n    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {\n        dc       = (blocks[0] - 0x4000) / scale;\n        *error  += FFABS(blocks[0] - 0x4000) % scale;\n        delta    = dc - prev_dc;\n        new_sign = GET_SIGN(delta);\n        delta    = (delta ^ sign) - sign;\n        code     = MAKE_CODE(delta);\n        bits    += estimate_vlc(ff_prores_dc_codebook[codebook], code);\n        codebook = (code + (code & 1)) >> 1;\n        codebook = FFMIN(codebook, 3);\n        sign     = new_sign;\n        prev_dc  = dc;\n    }\n    return bits;\n}']