[gs-cvs] rev 8747 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Mon May 19 07:47:53 PDT 2008


Author: leonardo
Date: 2008-05-19 07:47:52 -0700 (Mon, 19 May 2008)
New Revision: 8747

Modified:
   trunk/gs/src/gsptype1.c
Log:
Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued).

DETAILS :

Bug 689807 "segfault with 09-34.PS".

The last patch for the subject appears incomplete.
This one allows to write and read null patterns.
Debugged with 09-34.PS .

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gsptype1.c
===================================================================
--- trunk/gs/src/gsptype1.c	2008-05-17 21:33:47 UTC (rev 8746)
+++ trunk/gs/src/gsptype1.c	2008-05-19 14:47:52 UTC (rev 8747)
@@ -1342,6 +1342,8 @@
     int offset1 = offset;
     int code, l;
 
+    if (ptile == NULL)
+	return 0;
     if (psdc->type == pdevc->type) {
 	if (psdc->colors.pattern.id == ptile->id) {
 	    /* fixme : Do we need to check phase ? How ? */
@@ -1496,6 +1498,12 @@
     int code, l;
 
     if (offset == 0) {
+	if (size == 0) {
+	    /* Null pattern. */
+	    pdevc->type = &gx_dc_pattern;
+	    pdevc->colors.pattern.p_tile = NULL;
+	    return 0;
+	}
 	if (sizeof(buf) > size) {
 	    /* For a while we require the client to provide enough buffer size. */
 	    return_error(gs_error_unregistered); /* Must not happen. */



More information about the gs-cvs mailing list