sfnt: Cast a charcode to 32-bit in cmap format 12 parser.
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 41 42 43 44
diff --git a/ChangeLog b/ChangeLog
index 1103f19..8571ae1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ sfnt: Cast a charcode to 32-bit in cmap format 12 parser.
+
+ * src/sfnt/ttcmap.c (tt_cmap12_char_next):
+ Insert explicit cast from FT_UFast to FT_UInt32
+ for return value.
+
+2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
psaux: Fix a few casts to FT_Int32 value.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings):
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 54dceba..6bae57b 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -2228,8 +2228,10 @@
if ( cmap12->valid )
{
gindex = cmap12->cur_gindex;
+
+ /* XXX: check cur_charcode overflow is expected */
if ( gindex )
- *pchar_code = cmap12->cur_charcode;
+ *pchar_code = (FT_UInt32)cmap12->cur_charcode;
}
else
gindex = 0;
@@ -2237,7 +2239,8 @@
else
gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
- return gindex;
+ /* XXX: check gindex overflow is expected */
+ return (FT_UInt32)gindex;
}