diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-17 20:09:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-12 00:43:38 +0100 |
commit | 0701f7c5c3f9e8a336d1f5773a89a5e63f8f5497 (patch) | |
tree | 2a467143e085e4c5011f1766470d0d7916153313 | |
parent | cce6bdc7583997420a7a55406366afbe97f16de6 (diff) | |
download | ffmpeg-0701f7c5c3f9e8a336d1f5773a89a5e63f8f5497.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 62bc9f0dd5..0c2a965eb7 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -151,7 +151,7 @@ static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) static 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); |