diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-17 20:09:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-18 01:13:22 +0100 |
commit | 9847f02fafac16c1c3b72bad2f9bb5ccdd4d3678 (patch) | |
tree | b3e77915e9c1ef040ad5f83506fb9ccc3eb2156e | |
parent | dfdeabadcaf1a17e96c99375fc7893eb5cc04346 (diff) | |
download | ffmpeg-9847f02fafac16c1c3b72bad2f9bb5ccdd4d3678.tar.gz |
dnxhdenc: fix mb_rc size
Fixes out of array access with RC_VARIANCE set to 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f1caaa1c61310beba705957e6366f0392a0b005b)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/dnxhdenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 0af948e78b..ac19ea68b3 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -236,7 +236,7 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) static av_cold int dnxhd_init_rc(DNXHDEncContext *ctx) { - FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail); + FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*(ctx->m.avctx->qmax + 1)*sizeof(RCEntry), fail); if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD) FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail); |