use FT_UInt32 type to check UCS-2 codepoint overflow in cmap format 4 parser.

note: long type is too large for LP64 platforms.
int-not32-changes-2017
suzuki toshiya 7 years ago
parent 58dd3a1e6e
commit 8f36537406
  1. 12
      src/sfnt/ttcmap.c

@ -836,8 +836,8 @@
(FT_Int)end + delta >= 0 )
charcode = (FT_UInt)( -delta );
else if ( (FT_Int)charcode + delta < 0x10000L &&
(FT_Int)end + delta >= 0x10000L )
else if ( (FT_Int32)charcode + delta < 0x10000L &&
(FT_Int32)end + delta >= 0x10000L )
charcode = (FT_UInt)( 0x10000L - delta );
else
@ -1169,8 +1169,8 @@
(FT_Int)end + delta >= 0 )
charcode = (FT_UInt)( -delta );
else if ( (FT_Int)charcode + delta < 0x10000L &&
(FT_Int)end + delta >= 0x10000L )
else if ( (FT_Int32)charcode + delta < 0x10000L &&
(FT_Int32)end + delta >= 0x10000L )
charcode = (FT_UInt)( 0x10000L - delta );
else
@ -1407,8 +1407,8 @@
(FT_Int)end + delta >= 0 )
charcode = (FT_UInt)( -delta );
else if ( (FT_Int)charcode + delta < 0x10000L &&
(FT_Int)end + delta >= 0x10000L )
else if ( (FT_Int32)charcode + delta < 0x10000L &&
(FT_Int32)end + delta >= 0x10000L )
charcode = (FT_UInt)( 0x10000L - delta );
}
}

Loading…
Cancel
Save