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:
parent
361c4506fd
commit
d6654d906c
|
@ -129,7 +129,7 @@ Divide an integer and round upwards
|
||||||
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
|
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
|
||||||
{
|
{
|
||||||
assert(b);
|
assert(b);
|
||||||
return (a + b - 1) / b;
|
return (OPJ_INT32)(((OPJ_INT64)a + b - 1) / b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue