[FFmpeg-cvslog] dnxhdenc: fix mb_rc size
Michael Niedermayer
git at videolan.org
Mon Mar 10 19:00:46 CET 2014
ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 17 20:09:48 2014 +0100| [98f44b24b56bece934c6bb99e0acca3cc45fe5aa] | committer: Michael Niedermayer
dnxhdenc: fix mb_rc size
Fixes out of array access with RC_VARIANCE set to 0
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit f1caaa1c61310beba705957e6366f0392a0b005b)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98f44b24b56bece934c6bb99e0acca3cc45fe5aa
---
libavcodec/dnxhdenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index e4c6274..15543c1 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -220,7 +220,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);
More information about the ffmpeg-cvslog
mailing list