From: Robert Everson Date: Mon, 27 Aug 2018 22:28:53 +0000 (-0700) Subject: Cast on uint ceildiv X-Git-Tag: v2.3.1~22^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fa7ebe2540990f590c2247b3505ac1dc84b6eec;p=openjpeg Cast on uint ceildiv --- diff --git a/src/lib/openjp2/opj_intmath.h b/src/lib/openjp2/opj_intmath.h index ad135976..754b5512 100644 --- a/src/lib/openjp2/opj_intmath.h +++ b/src/lib/openjp2/opj_intmath.h @@ -170,7 +170,7 @@ Divide an integer and round upwards static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b) { assert(b); - return (a + b - 1) / b; + return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b); } /**