Commit da317efd authored by Michael Niedermayer's avatar Michael Niedermayer

j2k: reorder multiplications to avoid interger overflows related to precincts

Fixes CID703778, CID703777
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 45ae9a8f
...@@ -288,7 +288,7 @@ int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantSt ...@@ -288,7 +288,7 @@ int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantSt
band->cblk = av_malloc(sizeof(J2kCblk) * band->cblknx * band->cblkny); band->cblk = av_malloc(sizeof(J2kCblk) * band->cblknx * band->cblkny);
if (!band->cblk) if (!band->cblk)
return AVERROR(ENOMEM); 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) if (!band->prec)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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