summaryrefslogtreecommitdiff
path: root/base/gxpcmap.c
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2022-04-13 16:37:07 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2022-04-13 20:25:50 -0700
commit1a18793a02e1dab7676d594366b93847fde6fe44 (patch)
tree3ec8548d5763d3a357047d7b06a2dc8ce12439cc /base/gxpcmap.c
parent3e8878ec0a55b0d83365ba17ea48c4cff27be480 (diff)
downloadghostpdl-1a18793a02e1dab7676d594366b93847fde6fe44.tar.gz
Bug 705197 OSS 46307
In the example of Bug 705197 the PDF interpreter reuses a pattern during a circular reference causing an aliasing of two nested patterns, one of which has a softmask. The change in the buffer size of the inner one blows away the color information of the outer one leading to a mismatch of color spaces. Added a check in the pdf14 group composition to catch the case when the color space sizes are wrong and avoid buffer over-runs that would occur when we try to do the group composition. I return a Fatal error to the interpreter thinking it would stop but it seems to swallow this and continue on its way. Clearly being in this situation indicates something very bad has happened I would expect to see GS error out when this occurs.
Diffstat (limited to 'base/gxpcmap.c')
-rw-r--r--base/gxpcmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/base/gxpcmap.c b/base/gxpcmap.c
index 43682e03f..9f2683a67 100644
--- a/base/gxpcmap.c
+++ b/base/gxpcmap.c
@@ -947,7 +947,7 @@ gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile)
if (ctile->ttrans != NULL) {
if_debug2m('v', mem,
- "[v*] Freeing trans pattern from cache, uid = %ld id = %ld\n",
+ "[v*] Freeing trans pattern from cache, uid = %ld id = %u\n",
ctile->uid.id, ctile->id);
if ( ctile->ttrans->pdev14 == NULL) {
/* This can happen if we came from the clist */
@@ -1192,7 +1192,7 @@ gx_pattern_cache_add_entry(gs_gstate * pgs,
ctile->tmask.data = 0;
if (trans != 0) {
if_debug2m('v', pgs->memory,
- "[v*] Adding trans pattern to cache, uid = %ld id = %ld\n",
+ "[v*] Adding trans pattern to cache, uid = %ld id = %u\n",
ctile->uid.id, ctile->id);
ctile->ttrans = trans;
}
@@ -1524,7 +1524,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
if (code < 0)
goto fail;
if (pinst->templat.uses_transparency) {
- if_debug0m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n");
+ if_debug1m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state pat_id = %u\n", pinst->id);
if ((code = gs_push_pdf14trans_device(saved, true, false, 0, 0)) < 0) /* spot_color_count taken from pdf14 target values */
return code;
saved->device->is_open = true;