diff options
Diffstat (limited to 'gs/base/gxpcmap.c')
-rw-r--r-- | gs/base/gxpcmap.c | 16 |
1 files changed, 13 insertions, 3 deletions
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; |