aboutsummaryrefslogtreecommitdiffstats
path: root/main/ghostscript/0002-Bug-700599-Issue-an-error-message-if-an-ExtGstate-is.patch
blob: 5da83ab565c514e01893cc45bf8ecd1db88cf853 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: Ray Johnston <ray.johnston@artifex.com>
Date: Mon, 18 Feb 2019 12:11:45 -0800
Subject: Bug 700599: Issue an error message if an ExtGstate is not found.
Origin: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=be86d2ff2f0f0ea0e365707f3be0fa0c9e7315ee
Bug: https://bugs.ghostscript.com/show_bug.cgi?id=700599

Previously, this was silently ignored. Only issue a single warning,
and respect PDFSTOPONERROR to prevent continuing with potentially
incorrect output.

Note that tests_private/pdf/uploads/bug696410.pdf also now gets this
error message (ExtGState" instead of ExtGState in object 10).
---
 Resource/Init/pdf_draw.ps | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index 75b5eb622b52..c0201ad65da2 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -494,7 +494,16 @@ end
     dup {
       oforce exch gsparamdict exch .knownget { exec } { pop } ifelse
     } forall pop
-  } if
+  } {
+    //pdfdict /.gs_warning_issued known not {
+      (\n   **** Error 'gs' ignored -- ExtGState missing from Resources.\n)
+      pdfformaterror
+      (        Output may be incorrect.\n) pdfformaterror
+      //pdfdict /.gs_warning_issued //true .forceput
+      PDFSTOPONERROR { /gs /undefined signalerror } if
+    } if
+  }
+  ifelse
 } bind executeonly def
 
 % ------ Transparency support ------ %
-- 
2.20.1