Date: Wednesday, March 8, 2023 @ 19:10:24
  Author: andyrtr
Revision: 470434

upgpkg: ghostscript 10.0.0-6: apply upstream commit to fix a segfault when 
missing some font - FS#77261

Added:
  ghostscript/trunk/0001_Catch_and_act_on_error_code_during_PCL5_init.diff
Modified:
  ghostscript/trunk/PKGBUILD

--------------------------------------------------------+
 0001_Catch_and_act_on_error_code_during_PCL5_init.diff |   36 +++++++++++++++
 PKGBUILD                                               |   12 +++--
 2 files changed, 44 insertions(+), 4 deletions(-)

Added: 0001_Catch_and_act_on_error_code_during_PCL5_init.diff
===================================================================
--- 0001_Catch_and_act_on_error_code_during_PCL5_init.diff                      
        (rev 0)
+++ 0001_Catch_and_act_on_error_code_during_PCL5_init.diff      2023-03-08 
19:10:24 UTC (rev 470434)
@@ -0,0 +1,36 @@
+From: Chris Liddell <[email protected]>
+Date: Tue, 31 Jan 2023 10:16:45 +0000 (+0000)
+Subject: Bug 706360: Catch and act on error code during PCL5 init
+X-Git-Tag: rjw-test~16
+X-Git-Url: 
https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff_plain;h=936d966618c8
+
+Bug 706360: Catch and act on error code during PCL5 init
+
+Missing fonts is a fatal error, and we were ignoring the error from
+pcl_do_resets() due to "missing" fonts (i.e. non-romfs configs not supported).
+---
+
+diff --git a/pcl/pcl/pctop.c b/pcl/pcl/pctop.c
+index 224614d5d..38732d5e2 100644
+--- a/pcl/pcl/pctop.c
++++ b/pcl/pcl/pctop.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2001-2022 Artifex Software, Inc.
++/* Copyright (C) 2001-2023 Artifex Software, Inc.
+    All Rights Reserved.
+ 
+    This software is provided AS-IS with no warranty, either express or
+@@ -281,8 +281,11 @@ 
pcl_impl_allocate_interp_instance(pl_interp_implementation_t *impl,
+     /* Return success */
+     impl->interp_client_data = pcli;
+     /* Initial reset for the PCL interpreter */
+-    pcl_do_resets(&pcli->pcs, pcl_reset_initial);
+-    return 0;
++    code = pcl_do_resets(&pcli->pcs, pcl_reset_initial);
++    if (code < 0) {
++        (void)impl->proc_deallocate_interp_instance(impl);
++    }
++    return code;
+ }
+ 
+ /* if the device option string PCL is not given, the default

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-03-08 18:46:13 UTC (rev 470433)
+++ PKGBUILD    2023-03-08 19:10:24 UTC (rev 470434)
@@ -3,7 +3,7 @@
 pkgbase=ghostscript
 pkgname=(ghostscript ghostxps ghostpcl)
 pkgver=10.0.0
-pkgrel=5
+pkgrel=6
 pkgdesc="An interpreter for the PostScript language"
 url="https://www.ghostscript.com/";
 arch=('x86_64')
@@ -14,12 +14,13 @@
 # https://github.com/ArtifexSoftware/ghostpdl-downloads/releases
 
source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver//./}/ghostpdl-${pkgver}.tar.xz
         
#https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/ghostpdl-${pkgver/.0//}/ghostpdl-${pkgver}.tar.xz
-        2010_add_build_timestamp_setting.patch)
+        2010_add_build_timestamp_setting.patch
+        0001_Catch_and_act_on_error_code_during_PCL5_init.diff)
 # 
https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs1000/SHA512SUMS
 
sha512sums=('89b5a0bf6098c765c972aa1d1d524a4cb7682c20a87c176adb920ff7d4b92d557e1adcf8f10e8a805655c034b1966caf4b2cfc7ef5d75e5930f8ea8043011b16'
-            
'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d')
+            
'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d'
+            
'edba514969e18756b9a4f1839aea5fc77a67fa390db3ec39451b855d945bbaa27a0245cd5c2ff6d5a092fe9ddcd3185afa18fcc29bf87b3ec776d620a6e04c3b')
 
-
 ### update jbig2dec first! ###
 
 
@@ -60,6 +61,9 @@
 
   # Debian: # allow the build timestamp to be externally set
   patch -Np1 -i ../2010_add_build_timestamp_setting.patch
+
+  # FS#77261 - https://bugs.ghostscript.com/show_bug.cgi?id=706360
+  patch -Np1 -i ../0001_Catch_and_act_on_error_code_during_PCL5_init.diff
 }
 
 build() {

Reply via email to