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

alexcher at ghostscript.com alexcher at ghostscript.com
Mon Aug 6 17:40:18 PDT 2007


Author: alexcher
Date: 2007-08-06 17:40:18 -0700 (Mon, 06 Aug 2007)
New Revision: 8179

Modified:
   trunk/gs/src/gdevpdfd.c
Log:
Pacify MSVC 7 run time checks. Change the order of condition checking to avoid
returning an uninitialized value. The code is algorithmically equivalent,
except it doesn't assign anything instead of assigning an uninitialized value.
Bug 689387

DIFFERENCES:
None


Modified: trunk/gs/src/gdevpdfd.c
===================================================================
--- trunk/gs/src/gdevpdfd.c	2007-08-05 13:55:26 UTC (rev 8178)
+++ trunk/gs/src/gdevpdfd.c	2007-08-07 00:40:18 UTC (rev 8179)
@@ -455,20 +455,11 @@
 	      const gx_drawing_color * pdcolor, const gx_clip_path * pcpath)
 {
     bool new_clip;
-    int bottom = (pdev->ResourcesBeforeUsage ? 1 : 0);
-    gs_fixed_rect cbox;
     int code;
 
-    /*
-     * Check for an empty clipping path.
-     */
-    if (pcpath) {
-	gx_cpath_outer_box(pcpath, &cbox);
-	if (cbox.p.x >= cbox.q.x || cbox.p.y >= cbox.q.y)
-	    return 1;		/* empty clipping path */
-    }
     if (gx_dc_is_pure(pdcolor)) {
-	/*
+        int bottom = (pdev->ResourcesBeforeUsage ? 1 : 0);
+ 	/*
 	 * Make a special check for the initial fill with white,
 	 * which shouldn't cause the page to be opened.
 	 */
@@ -480,7 +471,17 @@
 		return 1;
         }
     }
-    *box = cbox;
+    /*
+     * Check for an empty clipping path.
+     */
+    if (pcpath) {
+        gs_fixed_rect cbox;
+
+	gx_cpath_outer_box(pcpath, &cbox);
+	if (cbox.p.x >= cbox.q.x || cbox.p.y >= cbox.q.y)
+	    return 1;		/* empty clipping path */
+        *box = cbox;
+    }
     new_clip = pdf_must_put_clip_path(pdev, pcpath);
     if (have_path || pdev->context == PDF_IN_NONE || new_clip) {
 	if (new_clip)



More information about the gs-cvs mailing list