diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2021-03-11 15:10:21 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2021-03-11 15:14:52 +0000 |
commit | 6f363900b32cc663c20477af20a76c806a5b9967 (patch) | |
tree | f6f13191c68302b81d8f4fee2742bcee7d5edff8 | |
parent | 5e90d4b7fa77dc710e6ff2b1955f6098c24e4bca (diff) | |
download | ghostpdl-6f363900b32cc663c20477af20a76c806a5b9967.tar.gz |
Fix ordering of operators in FitPage
Bug #703685 "Crash when using -dPDFFitPage"
The 'cvi' in pdf_PDF2PS_matrix in pdf_main.ps here was meant (I think)
to apply to the /Rotate value from the page dictionary, but instead
was applied to the divisor, 90, which isn't needed because 90 is
obviously already an integer.
If the PDF file (illegally) had a floating point number then the cvi
should convert it to an integer, so we need to move the cvi so that it
applies to the /Rotate value.
-rw-r--r-- | Resource/Init/pdf_main.ps | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps index a58875bb1..cbce79eb1 100644 --- a/Resource/Init/pdf_main.ps +++ b/Resource/Init/pdf_main.ps @@ -2559,7 +2559,7 @@ end readonly def 2 index sub exch 3 index sub exch 4 2 roll pop pop % stack: savedCTM <pdfpagedict> [Box] XImageable YImageable 2 index aload pop 2 index sub exch 3 index sub exch 4 2 roll pop pop - 5 index /Rotate pget not { 0 } if 90 cvi idiv 1 and 0 ne { exch } if + 5 index /Rotate pget not { 0 } if cvi 90 idiv 1 and 0 ne { exch } if % stack: savedCTM <pdfpagedict> [Box] XImageable YImageable XBox YBox 4 copy 3 -1 roll exch div 3 1 roll div .min |