opj_int_ceildiv(): fix int32 overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2494. Credit to OSS Fuzz

This commit is contained in:
Even Rouault 2017-07-28 22:15:47 +02:00
parent 361c4506fd
commit d6654d906c
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ Divide an integer and round upwards
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
{
assert(b);
return (a + b - 1) / b;
return (OPJ_INT32)(((OPJ_INT64)a + b - 1) / b);
}
/**