diff options
author | Sam James <sam@gentoo.org> | 2022-09-21 14:18:08 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-02 04:31:25 +0100 |
commit | a529111f77ff46f4836fe7312e70953bc16587cf (patch) | |
tree | 9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /psi/zdevice.c | |
parent | Import Ghostscript 9.56.1 (diff) | |
download | ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.tar.gz ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.tar.bz2 ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.zip |
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'psi/zdevice.c')
-rw-r--r-- | psi/zdevice.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/psi/zdevice.c b/psi/zdevice.c index 99beaff7..7e9779f7 100644 --- a/psi/zdevice.c +++ b/psi/zdevice.c @@ -45,7 +45,7 @@ ENUM_PTRS_WITH(psi_device_ref_enum_ptrs, psi_device_ref *devref) } case 0: { - if (devref->device->memory != NULL) { + if (devref->device != NULL && devref->device->memory != NULL) { ENUM_RETURN(gx_device_enum_ptr(devref->device)); } return 0; @@ -54,7 +54,7 @@ ENUM_PTRS_END static RELOC_PTRS_WITH(psi_device_ref_reloc_ptrs, psi_device_ref *devref) - if (devref->device->memory != NULL) { + if (devref->device != NULL && devref->device->memory != NULL) { devref->device = gx_device_reloc_ptr(devref->device, gcst); } RELOC_PTRS_END @@ -71,7 +71,7 @@ psi_device_ref_finalize(const gs_memory_t *cmem, void *vptr) /* pdref->device->memory == NULL indicates either a device prototype or a device allocated on the stack rather than the heap */ - if (pdref->device->memory != NULL) + if (pdref->device != NULL && pdref->device->memory != NULL) rc_decrement(pdref->device, "psi_device_ref_finalize"); pdref->device = NULL; @@ -456,6 +456,7 @@ zmakewordimagedevice(i_ctx_t *i_ctx_p) return_error(gs_error_VMerror); } psdev->device = new_dev; + rc_increment(new_dev); make_tav(op - 4, t_device, imemory_space(iimemory) | a_all, pdevice, psdev); pop(4); } |