[truetype] Fix integer type (#45965).

* src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.
This commit is contained in:
Werner Lemberg 2015-09-15 07:23:53 +02:00
parent 577daf1c30
commit 7f0f40116d
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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> 2015-09-15 Werner Lemberg <wl@gnu.org>
* src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964). * src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964).

View File

@ -191,7 +191,7 @@
{ {
FT_Error error; FT_Error error;
FT_UInt32 checksum = 0; FT_UInt32 checksum = 0;
int i; FT_UInt i;
if ( FT_FRAME_ENTER( length ) ) if ( FT_FRAME_ENTER( length ) )
@ -200,8 +200,8 @@
for ( ; length > 3; length -= 4 ) for ( ; length > 3; length -= 4 )
checksum += (FT_UInt32)FT_GET_ULONG(); checksum += (FT_UInt32)FT_GET_ULONG();
for ( i = 3; length > 0; length --, i-- ) for ( i = 3; length > 0; length--, i-- )
checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) ); checksum += (FT_UInt32)FT_GET_BYTE() << ( i * 8 );
FT_FRAME_EXIT(); FT_FRAME_EXIT();