Sophie

Sophie

distrib > Mageia > 6 > x86_64 > by-pkgid > 09236aad26217818763c178cc3a83744 > files > 6

ghostscript-9.24-1.5.mga6.src.rpm

From 5812b1b78fc4d36fdc293b7859de69241140d590 Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Tue, 4 Sep 2018 23:18:46 +0100
Subject: [PATCH] Bug 699714: retain .LockSafetyParams through failed
 .installpagedevice

In the event that the .trysetparams fails during .installpagedevice, catch the
error, and ensure that at least the .LockSafetyParams is set.
---
 Resource/Init/gs_setpd.ps | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Resource/Init/gs_setpd.ps b/Resource/Init/gs_setpd.ps
index bba3c8c..aee9614 100644
--- a/Resource/Init/gs_setpd.ps
+++ b/Resource/Init/gs_setpd.ps
@@ -95,12 +95,19 @@ level2dict begin
  {	% Since setpagedevice doesn't create new device objects,
         % we must (carefully) reinstall the old parameters in
         % the same device.
-   .currentpagedevice pop //null currentdevice //null .trysetparams
+   .currentpagedevice pop //null currentdevice //null
+   {.trysetparams} .internalstopped
+   {
+     //null
+   } if
    dup type /booleantype eq
     { pop pop }
-    {		% This should never happen!
+    {
       SETPDDEBUG { (Error in .trysetparams!) = pstack flush } if
       cleartomark pop pop pop
+      % if resetting the entire device state failed, at least put back the se
+      currentdevice //null //false mark /.LockSafetyParams .currentpagedevice pop
+      /.LockSafetyParams .knownget not {//false} if .putdeviceparamsonly
       /.installpagedevice cvx /rangecheck signalerror
     }
    ifelse pop pop
-- 
2.9.1