From 0ec0b2594c77da669e8ca6357970793a02166e86 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Thu, 8 Jan 2015 23:18:52 +0000 Subject: [PATCH] [1.5] fixed int_ceildivpow2 implementation (backport from trunk) Update issue 388 --- libopenjpeg/int.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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