[cff] Ignore CID > 0xFFFFU. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if greater than 0xFFFFU. CFF font spec does not mention about maximum CID in the font, but PostScript and PDF spec define that maximum CID is 0xFFFFU.
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
diff --git a/ChangeLog b/ChangeLog
index ea1daa2..8544a41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ [cff] Ignore CID > 0xFFFFU.
+ See Savannah bug #30975.
+
+ * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if
+ greater than 0xFFFFU. CFF font spec does not mention about
+ maximum CID in the font, but PostScript and PDF spec define
+ that maximum CID is 0xFFFFU.
+
+2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
[cff] Make trace message in cff_charset_load() verbose.
See Savannah bug #30975.
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 6a1842f..8f29343 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -779,8 +779,15 @@
goto Exit;
for ( i = 0; i < num_glyphs; i++ )
- if ( charset->sids[i] > max_cid )
+ {
+ if ( charset->sids[i] > 0xFFFFU )
+ FT_ERROR(( "cff_charset_compute_cids():"
+ " ignore CID (0x%lx) for SID (0x%lx),"
+ " greater than PS/PDF spec\n",
+ charset->sids[i], i ));
+ else if ( charset->sids[i] > max_cid )
max_cid = charset->sids[i];
+ }
if ( FT_NEW_ARRAY( charset->cids, max_cid + 1 ) )
goto Exit;