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

leonardo at ghostscript.com leonardo at ghostscript.com
Sun Jan 7 09:44:41 PST 2007


Author: leonardo
Date: 2007-01-07 09:44:41 -0800 (Sun, 07 Jan 2007)
New Revision: 7578

Modified:
   trunk/gs/src/gsshade.c
Log:
Fix (shadings) : Ignore a huge BBox.

DETAILS :

Bug 689027 "Error: /rangecheck in --.buildshading2--".

A buggy software "xFlow Normalizer 1.0" created a huge shading BBox.
Adobe appears to ignores it silently.
In this case the clipping box sets a natural extent for the shading.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gsshade.c
===================================================================
--- trunk/gs/src/gsshade.c	2007-01-07 06:48:38 UTC (rev 7577)
+++ trunk/gs/src/gsshade.c	2007-01-07 17:44:41 UTC (rev 7578)
@@ -485,17 +485,22 @@
 		    code = gs_note_error(gs_error_VMerror);
 		    goto out;
 		}
-		if ((code = gx_cpath_from_rectangle(path_clip, &path_box)) < 0 ||
-		    (code = shading_path_add_box(box_path, &psh->params.BBox,
-						pmat)) < 0 ||
-		    (code = gx_cpath_intersect(path_clip, box_path,
-					    gx_rule_winding_number, pis)) < 0
-		    )
-		    DO_NOTHING;
+		code = gx_cpath_from_rectangle(path_clip, &path_box);
+		if (code >= 0) {
+		    code = shading_path_add_box(box_path, &psh->params.BBox, pmat);
+		    if (code == gs_error_limitcheck) {
+			/* Ignore huge BBox - bug 689027. */
+			code = 0;
+		    } else if (code >= 0) {
+			code = gx_cpath_intersect(path_clip, box_path,
+					    gx_rule_winding_number, pis);
+			if (code >= 0)
+			    path_clip_set = true;
+		    }
+		}
 		gx_path_free(box_path, "shading_fill_path(box_path)");
 		if (code < 0)
 		    goto out;
-		path_clip_set = true;
 	    }
 	}
 	if (!path_clip_set) {



More information about the gs-cvs mailing list