Commit b112fa41907710113aa63cbe3434f12f54096163

Werner Lemberg 2013-05-12T07:29:04

Fix Savannah bug #38967. * src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.

diff --git a/ChangeLog b/ChangeLog
index f3be77c..003b769 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2013-05-12  Werner Lemberg  <wl@gnu.org>
 
+	Fix Savannah bug #38967.
+
+	* src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.
+
+2013-05-12  Werner Lemberg  <wl@gnu.org>
+
 	Introduce unsigned 64bit type (if available).
 
 	* include/freetype/config/ftconfig.h: Define FT_UINT64 if available.
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 9c7ea5c..0ec0d78 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -264,7 +264,7 @@
       q = 0x7FFFFFFFL;
     else
       /* compute result directly */
-      q = (FT_UInt32)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );
+      q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b );
 
     return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
   }