[gs-cvs] rev 8863 - trunk/gs/src
ken at ghostscript.com
ken at ghostscript.com
Tue Jul 22 07:23:26 PDT 2008
Author: ken
Date: 2008-07-22 07:23:25 -0700 (Tue, 22 Jul 2008)
New Revision: 8863
Modified:
trunk/gs/src/zfcid1.c
Log:
Fix (pdfwrite): limit checking of CIDfonts for 'fixed width' property.
Details:
Bug 689963 "Infinite loop converting PostScript to PDF"
In fact the loop is not infinite, but it does take a long time. When checking to see if a
font is non-proportional, ie all glyphs have the same width, and the font is a CIDFont, we
did not stop testing when the CID exceeded the maximum CID in the font instance. Instead
we continued to the full CID range (0xffffffff). Because the TrueType code returns a
default for missing glyphs if the font was truly non-proportional then it would take a
long time to search the entire range.
(zfcid1.c): In z11_enumerate_glyph, check the requested CID against the CIDCount for the
font. Return a rangecheck if we exceed it.
I believe only pdfwrite uses this code currently.
EXPECTED DIFFERENCES:
None.
Modified: trunk/gs/src/zfcid1.c
===================================================================
--- trunk/gs/src/zfcid1.c 2008-07-22 06:24:14 UTC (rev 8862)
+++ trunk/gs/src/zfcid1.c 2008-07-22 14:23:25 UTC (rev 8863)
@@ -214,6 +214,9 @@
int code0 = z11_CIDMap_proc(pfont, GS_MIN_CID_GLYPH);
int code;
+ if(*pindex > pfont->cidata.common.CIDCount)
+ return_error(e_rangecheck);
+
for (;;) {
code = z11_CIDMap_proc(pfont, GS_MIN_CID_GLYPH + *pindex);
More information about the gs-cvs
mailing list