Commit 7f0f40116daac4e9a8c11b8f3026fe0c07bdb901

Werner Lemberg 2015-09-15T07:23:53

[truetype] Fix integer type (#45965). * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.

diff --git a/ChangeLog b/ChangeLog
index bf71948..ec9e8d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2015-09-15  Werner Lemberg  <wl@gnu.org>
 
+	[truetype] Fix integer type (#45965).
+
+	* src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.
+
+2015-09-15  Werner Lemberg  <wl@gnu.org>
+
 	* src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964).
 
 2015-09-15  Werner Lemberg  <wl@gnu.org>
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index af44259..6060d6f 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -191,7 +191,7 @@
   {
     FT_Error   error;
     FT_UInt32  checksum = 0;
-    int        i;
+    FT_UInt    i;
 
 
     if ( FT_FRAME_ENTER( length ) )
@@ -200,8 +200,8 @@
     for ( ; length > 3; length -= 4 )
       checksum += (FT_UInt32)FT_GET_ULONG();
 
-    for ( i = 3; length > 0; length --, i-- )
-      checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) );
+    for ( i = 3; length > 0; length--, i-- )
+      checksum += (FT_UInt32)FT_GET_BYTE() << ( i * 8 );
 
     FT_FRAME_EXIT();