diff --git a/libopenjpeg/int.h b/libopenjpeg/int.h index 4e5fe08e..a5563f46 100644 --- a/libopenjpeg/int.h +++ b/libopenjpeg/int.h @@ -91,7 +91,7 @@ Divide an integer by a power of 2 and round upwards @return Returns a divided by 2^b */ static INLINE int int_ceildivpow2(int a, int b) { - return (a + (1 << b) - 1) >> b; + return (int)((a + (int64_t)(1 << b) - 1) >> b); } /** Divide an integer by a power of 2 and round downwards