From da317efd92561290952a8aa191f1e5ea498a27c4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 22 Oct 2012 23:56:14 +0200 Subject: [PATCH] j2k: reorder multiplications to avoid interger overflows related to precincts Fixes CID703778, CID703777 Signed-off-by: Michael Niedermayer --- libavcodec/j2k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/j2k.c b/libavcodec/j2k.c index 196d7fddcd..f5b40b1b32 100644 --- a/libavcodec/j2k.c +++ b/libavcodec/j2k.c @@ -288,7 +288,7 @@ int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantSt band->cblk = av_malloc(sizeof(J2kCblk) * band->cblknx * band->cblkny); if (!band->cblk) return AVERROR(ENOMEM); - band->prec = av_malloc(reslevel->num_precincts_x * reslevel->num_precincts_y * sizeof(J2kPrec)); + band->prec = av_malloc(sizeof(J2kCblk) * reslevel->num_precincts_x * reslevel->num_precincts_y); if (!band->prec) return AVERROR(ENOMEM);