[truetype] Fix integer type (#45965). * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
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();