[ghostscript/f12/master] Avoid epstopdf failure using upstream patch (bug #627390).

Tim Waugh twaugh at fedoraproject.org
Thu Aug 26 14:21:20 UTC 2010


commit c755f33188cc89bd9351cd08fa71e477d06f281a
Author: Tim Waugh <twaugh at redhat.com>
Date:   Thu Aug 26 14:54:26 2010 +0100

    Avoid epstopdf failure using upstream patch (bug #627390).

 ghostscript-epstopdf-failure.patch |   50 ++++++++++++++++++++++++++++++++++++
 ghostscript.spec                   |    5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/ghostscript-epstopdf-failure.patch b/ghostscript-epstopdf-failure.patch
new file mode 100644
index 0000000..44b8149
--- /dev/null
+++ b/ghostscript-epstopdf-failure.patch
@@ -0,0 +1,50 @@
+diff -up ghostscript-8.71/base/seexec.c.epstopdf-failure ghostscript-8.71/base/seexec.c
+--- ghostscript-8.71/base/seexec.c.epstopdf-failure	2009-08-14 05:12:58.000000000 +0100
++++ ghostscript-8.71/base/seexec.c	2010-08-26 14:53:05.662840885 +0100
+@@ -165,7 +165,11 @@ hp:	r = *pr;
+ 	    r.limit = r.ptr + ss->hex_left;
+ 	status = s_hex_process(&r, pw, &ss->odd, 
+ 	  (ss->is_leading_space ? hex_ignore_leading_whitespace : hex_break_on_whitespace));
+-        ss->is_leading_space = (status == 2);
++        if (status == 2) {
++            ss->is_leading_space = true;
++            status = 1;
++        } else
++            ss->is_leading_space = false;
+ 	pr->ptr = r.ptr;
+ 	ss->hex_left -= r.ptr - start;
+ 	/*
+diff -up ghostscript-8.71/base/sstring.c.epstopdf-failure ghostscript-8.71/base/sstring.c
+--- ghostscript-8.71/base/sstring.c.epstopdf-failure	2009-08-13 20:04:34.000000000 +0100
++++ ghostscript-8.71/base/sstring.c	2010-08-26 14:53:05.663840592 +0100
+@@ -355,8 +355,12 @@ const stream_template s_PSSD_template =
+ /* ------ Utilities ------ */
+ 
+ /*
+- * Convert hex data to binary.  Return 1 if we filled the string, 0 if
+- * we ran out of input data before filling the string, or ERRC on error.
++ * Convert hex data to binary. 
++ * Return 1 if we filled the string,
++ *        0 if we ran out of input data before filling the string,
++ *        2 if hex_break_on_whitespace is on and we encounrered
++ *          a white space.
++ *        ERRC on error.
+  * The caller must set *odd_digit to -1 before the first call;
+  * after each call, if an odd number of hex digits has been read (total),
+  * *odd_digit is the odd digit value, otherwise *odd_digit = -1.
+diff -up ghostscript-8.71/psi/iscan.c.epstopdf-failure ghostscript-8.71/psi/iscan.c
+--- ghostscript-8.71/psi/iscan.c.epstopdf-failure	2009-11-11 13:52:23.000000000 +0000
++++ ghostscript-8.71/psi/iscan.c	2010-08-26 14:53:05.665840572 +0100
+@@ -329,9 +329,9 @@ scan_handle_refill(i_ctx_t *i_ctx_p, sca
+ 					       rstate, 1, cont);
+ 	    }
+     }
+-    /* No more data available, but no exception.  How can this be? */
+-    lprintf("Can't refill scanner input buffer!");
+-    return_error(e_Fatal);
++    /* No more data available, but no exception. */
++    /* A filter is consuming headers but returns nothing. */
++    return 0;
+ }
+ 
+ /*
diff --git a/ghostscript.spec b/ghostscript.spec
index ae4c0af..867caf0 100644
--- a/ghostscript.spec
+++ b/ghostscript.spec
@@ -38,6 +38,7 @@ Patch20: ghostscript-CVE-2010-1628.patch
 Patch21: ghostscript-jbig2-image-refcount.patch
 Patch22: ghostscript-SEARCH_HERE_FIRST.patch
 Patch23: ghostscript--P-.patch
+Patch24: ghostscript-epstopdf-failure.patch
 
 Requires: urw-fonts >= 1.1, ghostscript-fonts
 BuildRequires: xz
@@ -178,6 +179,9 @@ rm -rf libpng zlib jpeg jasper
 # Use -P- and -dSAFER in scripts (bug #599564).
 %patch23 -p1 -b .-P-
 
+# Avoid epstopdf failure using upstream patch (bug #627390).
+%patch24 -p1 -b .epstopdf-failure
+
 # Convert manual pages to UTF-8
 from8859_1() {
 	iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
@@ -367,6 +371,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Thu Aug 26 2010 Tim Waugh <twaugh at redhat.com> 8.71-11
+- Avoid epstopdf failure using upstream patch (bug #627390).
 - More upstream fixes for bug #599564.
 
 * Wed Aug 25 2010 Tim Waugh <twaugh at redhat.com> 8.71-10


More information about the scm-commits mailing list