Commit 45ae9a8f authored by Michael Niedermayer's avatar Michael Niedermayer

j2k: reorder multiplications to avoid interger overflows related to code blocks

Fixes CID703776, CID703775
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7c2d5eec
......@@ -285,7 +285,7 @@ int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantSt
band->cblknx = ff_j2k_ceildiv(band->cblknx, dx);
band->cblkny = ff_j2k_ceildiv(band->cblkny, dy);
band->cblk = av_malloc(band->cblknx * band->cblkny * sizeof(J2kCblk));
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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment