From 0fa7ebe2540990f590c2247b3505ac1dc84b6eec Mon Sep 17 00:00:00 2001 From: Robert Everson Date: Mon, 27 Aug 2018 15:28:53 -0700 Subject: [PATCH] Cast on uint ceildiv --- src/lib/openjp2/opj_intmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } /**