File ghostscript-8.60-pdf.dif of Package ghostscript-library

--- lib/pdf_main.ps
+++ lib/pdf_main.ps	2007-08-02 16:32:43.745320000 +0200
@@ -1291,11 +1291,15 @@ currentdict /PDF2PS_matrix_key undef
   % Determine the number of spot colors used on the page.  Note: This searches
   % the pages resources.  It may be high if a spot color is in a resource but
   % is not actually used on the page.
-  << /PageSpotColors 3 index countspotcolors >> setpagedevice
+  currentpagedevice /PageSpotColors known {
+    << /PageSpotColors 3 index countspotcolors >> setpagedevice
+  } if
 
   % Let the device know if we will be using PDF 1.4 transparency.
   % The clist logic may need to adjust the size of bands.
-  1 index pageusestransparency /PageUsesTransparency exch def
+  currentpagedevice /PageUsesTransparency known {
+    1 index pageusestransparency /PageUsesTransparency exch def
+  } if
   dup /Install .knownget {
 			% Don't let the Install procedure get more deeply
 			% nested after every page.
@@ -1418,7 +1422,9 @@ currentdict /PDF2PS_matrix_key undef
   end			% scratch dict
   % Indicate that the number of spot colors is unknown in case the next page
   % imaged is a PS file.
-  << /PageSpotColors -1 >> setpagedevice
+  currentpagedevice /PageSpotColors known {
+    << /PageSpotColors -1 >> setpagedevice
+  } if
   % Some PDF files don't have matching q/Q (gsave/grestore) so we need
   % to clean up any left over dicts from the dictstack
   countdictstack PDFdictstackcount sub dup 0 ne { 
--- src/gdevbbox.c
+++ src/gdevbbox.c	2007-08-06 12:36:13.494748000 +0200
@@ -1167,6 +1167,17 @@ bbox_create_compositor(gx_device * dev,
 {
     gx_device_bbox *const bdev = (gx_device_bbox *) dev;
     gx_device *target = bdev->target;
+    const gs_state *ps = (const gs_state *)pis;
+
+    /*
+     * Do not create a compositor for the target if overprint is active,
+     * this because then it is possible that the current page is erased
+     * for a bbox which equals the current page.
+     */
+    if (gs_currentoverprint(ps) || gs_currentoverprintmode(ps)) {
+	*pcdev = dev;
+	return 0;
+    }
 
     /*
      * If there isn't a target, all we care about is the bounding box,
--- src/gdevpdfo.c
+++ src/gdevpdfo.c	2007-08-06 12:53:56.761057749 +0200
@@ -1065,6 +1065,9 @@ cos_dict_equal(const cos_object_t *pco0,
 	const cos_value_t *v = cos_dict_find(pcd1, pcde0->key.data, pcde0->key.size);
 	int code;
 
+	if (cos_type(v->contents.object) != cos_type_dict)
+	    return false;	/* Should _never_ happen */
+
 	if (v == NULL)
 	    return false;
 	code = cos_value_equal(&pcde0->value, v, pdev);
--- src/gdevpdfr.c
+++ src/gdevpdfr.c	2007-08-06 12:54:38.601594553 +0200
@@ -307,8 +307,12 @@ pdf_scan_token(const byte **pscan, const
 	stream_cursor_write w;
 	stream_PSSD_state ss;
 	int status;
-
+#if 0
 	s_PSSD_init((stream_state *)&ss);
+#else
+	s_PSSD_partially_init_inline(&ss);
+	ss.from_string = true;
+#endif
 	r.ptr = p;		/* skip the '(' */
 	r.limit = end - 1;
 	w.limit = buf + sizeof(buf) - 1;
openSUSE Build Service is sponsored by