diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2009-07-05 04:15:24 +0000 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2009-07-05 04:15:24 +0000 |
commit | a0c92173ae08b0693eb7da5f6f76e59f4dc012d9 (patch) | |
tree | fa9769cf31bbe323cea3ae298bcb8095a34efa68 /gs | |
parent | f3e894a0e330ef007dec02053ba23f0d34b3c30c (diff) | |
download | ghostpdl-a0c92173ae08b0693eb7da5f6f76e59f4dc012d9.tar.gz |
Fix for access violations when transparency pattern is stored and read from clist.
DETAILS:
When we are rendering with the clist, there is no pdf14 device that is associated with the pattern. During immediate processing a pointer to that device is contained and used for debug purposes however the pointer is NULL during the clist reading phase.
git-svn-id: http://svn.ghostscript.com/ghostscript/branches/pattern_trans@9840 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs')
-rw-r--r-- | gs/base/gdevp14.c | 16 | ||||
-rw-r--r-- | gs/base/gxpcmap.c | 16 |
2 files changed, 22 insertions, 10 deletions
diff --git a/gs/base/gdevp14.c b/gs/base/gdevp14.c index b0ed2cb40..fd4c7ee74 100644 --- a/gs/base/gdevp14.c +++ b/gs/base/gdevp14.c @@ -1449,13 +1449,15 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis, pdf14_device * ppatdev14 = pdcolor->colors.pattern.p_tile->ttrans->pdev14; - dump_raw_buffer(ppatdev14->ctx->stack->rect.q.y-ppatdev14->ctx->stack->rect.p.y, - ppatdev14->ctx->stack->rect.q.x-ppatdev14->ctx->stack->rect.p.x, - ppatdev14->ctx->stack->n_planes, - ppatdev14->ctx->stack->planestride, ppatdev14->ctx->stack->rowstride, - "Pattern_Fill",ppatdev14->ctx->stack->data); - - global_index++; + if (ppatdev14 != NULL) { /* can occur during clist reading */ + dump_raw_buffer(ppatdev14->ctx->stack->rect.q.y-ppatdev14->ctx->stack->rect.p.y, + ppatdev14->ctx->stack->rect.q.x-ppatdev14->ctx->stack->rect.p.x, + ppatdev14->ctx->stack->n_planes, + ppatdev14->ctx->stack->planestride, ppatdev14->ctx->stack->rowstride, + "Pattern_Fill",ppatdev14->ctx->stack->data); + + global_index++; + } #endif diff --git a/gs/base/gxpcmap.c b/gs/base/gxpcmap.c index 8bd8bcd67..b7d6b4019 100644 --- a/gs/base/gxpcmap.c +++ b/gs/base/gxpcmap.c @@ -696,9 +696,19 @@ gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile) if (ctile->ttrans != NULL) { - dev_proc(ctile->ttrans->pdev14, close_device)((gx_device *)ctile->ttrans->pdev14); - ctile->ttrans->pdev14 = NULL; /* should be ok due to pdf14_close */ - ctile->ttrans->transbytes = NULL; /* should be ok due to pdf14_close */ + if ( ctile->ttrans->pdev14 == NULL) { + + /* This can happen if we came from the clist */ + gs_free_object(mem,ctile->ttrans->transbytes,"free_pattern_cache_entry(transbytes)"); + ctile->ttrans->transbytes = NULL; + + } else { + + dev_proc(ctile->ttrans->pdev14, close_device)((gx_device *)ctile->ttrans->pdev14); + ctile->ttrans->pdev14 = NULL; /* should be ok due to pdf14_close */ + ctile->ttrans->transbytes = NULL; /* should be ok due to pdf14_close */ + } + gs_free_object(mem, ctile->ttrans, "free_pattern_cache_entry(ttrans)"); ctile->ttrans = NULL; |