summaryrefslogtreecommitdiff
path: root/Resource
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2021-10-06 17:35:25 +0100
committerKen Sharp <ken.sharp@artifex.com>2021-10-06 17:35:25 +0100
commitfbe227d1e13da0d5d30c2d627b3824f9dc61c729 (patch)
treefdaeefe8ed335ae7b2da51a674da5971f6d22729 /Resource
parentf0e2e035276ca050c5853df9d59a4cd0b6394671 (diff)
downloadghostpdl-fbe227d1e13da0d5d30c2d627b3824f9dc61c729.tar.gz
PDF Interpreter - Document and update previous work-around
The customer file has annotations with appearance streams which have been compressed, but do not have a compression filter in the stream dictionary. At least one of the streams has a ']' in the data, and since we are interpreting the data directly this can correspond with a matching mark on the stack, or throw an unmatched mark error. Either way this can lead to stack corruption and other problems. We did already execute the annotation in a stopped context, but if that threw an error then, as part of the error recovery, we would run a 'cleartomark'. If the stream had removed the mark we needed then that would throw an error (which is what happens here). Commit 4870aa85f14c900d47b5c1ba5eec48c64c384cad accidentally included a patch to work around this by executing the error recovery inside a stopped context so that we can recover from an error while recovering from the previous error. This way madness lies...... This commit simply documents that previous accidental inclusion, and adds a little more feedback for the user.
Diffstat (limited to 'Resource')
-rw-r--r--Resource/Init/pdf_main.ps6
1 files changed, 4 insertions, 2 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index fba4a6074..501faea67 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -3949,9 +3949,11 @@ currentdict /PDF2PS_matrix_key undef
not
and
//systemdict /PreserveAnnots .knownget not {//true} if and {
- mark exch {preserveannot} PDFSTOPONERROR {exec}{stopped {(Error: Ignoring invalid annotation, output may be incorrect.\n) pdfformaterror} if} ifelse {cleartomark} stopped pop
+ mark exch {preserveannot} PDFSTOPONERROR {exec}{stopped {(Error: Ignoring invalid annotation, output may be incorrect.\n) pdfformaterror} if} ifelse {cleartomark} stopped
+ {(Error: Failed to clean up after annotation, output may be incorrect.\n) pdfformaterror}if
}{
- mark exch {drawannot} PDFSTOPONERROR {exec}{stopped {(Error: Ignoring invalid annotation, output may be incorrect.\n) pdfformaterror} if} ifelse {cleartomark} stopped pop
+ mark exch {drawannot} PDFSTOPONERROR {exec}{stopped {(Error: Ignoring invalid annotation, output may be incorrect.\n) pdfformaterror} if} ifelse {cleartomark} stopped
+ {(Error: Failed to clean up after annotation, output may be incorrect.\n) pdfformaterror}if
} ifelse
} {
pop