[gs-cvs] gs/src

L. Peter Deutsch lpd at casper.ghostscript.com
Fri Jun 7 18:22:29 PDT 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv8702/src

Modified Files:
	zcharout.c 
Log Message:

Fix: enumerate_glyph would crash if applied to a subfont of a CIDFontType 0
font.  (Probably only affects font copying, to be used in the future by
pdfwrite.)


Index: zcharout.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/zcharout.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- zcharout.c	2 Jun 2002 12:00:54 -0000	1.8
+++ zcharout.c	8 Jun 2002 01:22:26 -0000	1.9
@@ -363,6 +363,9 @@
  * Enumerate the next glyph from a directory.  This is essentially a
  * wrapper around dict_first/dict_next to implement the enumerate_glyph
  * font procedure.
+ *
+ * Note that *prdict will be null if the font is a subfont of a
+ * CIDFontType 0 CIDFont.
  */
 int
 zchar_enumerate_glyph(const ref *prdict, int *pindex, gs_glyph *pglyph)
@@ -370,6 +373,8 @@
     int index = *pindex - 1;
     ref elt[2];
 
+    if (!r_has_type(prdict, t_dictionary))
+	return 0;		/* *pindex was 0, is still 0 */
     if (index < 0)
 	index = dict_first(prdict);
 next:




More information about the gs-cvs mailing list