diff options
author | ray <Ray.Johnston@artifex.com> | 2020-06-07 09:45:57 -0700 |
---|---|---|
committer | ray <Ray.Johnston@artifex.com> | 2020-06-08 08:24:15 -0700 |
commit | 748edd2fd75c684d63486eded71ad20254de6f4c (patch) | |
tree | 830d584b656f4ea6f9f6a931c80112bb4a07a4b5 /psi/ztrans.c | |
parent | 560ff82b0bc782465aa4591b2953954d7cf5608c (diff) | |
download | ghostpdl-748edd2fd75c684d63486eded71ad20254de6f4c.tar.gz |
Fix Bug 702383 - Segfault due to mis-use of PostScript transparency.
The fix for Bug 698306 fixed that case, but this case showed that the double
calls to .pushpdf14devicefilter still could cause problems. Another patch
already resolved calling transparency operations WITHOUT pushing the pdf14
device (for Bug 702327).
Also undefine the PostScript transparency operators to (maybe) prevent
misuse if -dALLOWPSTRANSPARENCY is not specified.
Diffstat (limited to 'psi/ztrans.c')
-rw-r--r-- | psi/ztrans.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psi/ztrans.c b/psi/ztrans.c index b1600e297..4a26bdd49 100644 --- a/psi/ztrans.c +++ b/psi/ztrans.c @@ -475,6 +475,9 @@ zpushpdf14devicefilter(i_ctx_t *i_ctx_p) gx_device *cdev = gs_currentdevice_inline(igs); check_type(*op, t_integer); + if (dev_proc(cdev, dev_spec_op)(cdev, gxdso_is_pdf14_device, NULL, 0) > 0) + return 0; /* ignore push_device if already is pdf14 device */ + /* Bug 698087: In case some program uses our .pushpdf14devicefilter make */ /* sure that the device knows that we are using the pdf14 */ /* transparency. Note this will close and re-open the device */ @@ -495,8 +498,6 @@ zpushpdf14devicefilter(i_ctx_t *i_ctx_p) if (cdev->is_open) { if ((code = gs_closedevice((gx_device *)cdev)) < 0) return code; - if (dev_proc(cdev, dev_spec_op)(cdev, gxdso_is_pdf14_device, NULL, 0) > 0) - pdf14_disable_device(cdev); /* should already be disabled (bug 698306) */ } if ((code = gs_opendevice((gx_device *)cdev)) < 0) return code; |