Cast on uint ceildiv 1136/head
authorRobert Everson <robert@reverson.net>
Mon, 27 Aug 2018 22:28:53 +0000 (15:28 -0700)
committerRobert Everson <robert@reverson.net>
Mon, 27 Aug 2018 22:28:53 +0000 (15:28 -0700)
src/lib/openjp2/opj_intmath.h

index ad13597661319d8eda186143e3fb7b2c0019bdd3..754b5512ff2cf64640359c21d23259076fab7159 100644 (file)
@@ -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);
 }
 
 /**