From 151067bbc2200e3130eb9e4bab242dfd8db78761 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 10 Feb 2013 17:50:56 +0100 Subject: [PATCH] dpx: Fix rounding in 10bit total_size calculation This could have caused out of array reads Signed-off-by: Michael Niedermayer --- libavcodec/dpx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 92c0e4b8d1..0237b44784 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -159,7 +159,7 @@ static int decode_frame(AVCodecContext *avctx, return -1; } avctx->pix_fmt = AV_PIX_FMT_GBRP10; - total_size = (4 * avctx->width * avctx->height * elements) / 3; + total_size = (avctx->width * avctx->height * elements + 2) / 3 * 4; break; case 12: if (!packing) {