Fix for 688011 Segment fault with -r150 and the mswindll device

"Dan Coby" <[email protected]> Wed, 30 Mar 2005 15:44:17 -0800
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Fix for 688011 Segment fault with -r150 and the mswindll device.

DETAILS:

The routine gx_image_cached_char creates a mono bit memory device with
the memory structure pointer set to 0.  It then passes this device to
win_render_char which seg faults when it tries to allocate memory for
a bit map.

The fix consists of using the parent device's memory structure for the
mono bit memory device.


Dan


Index: src/gxccache.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxccache.c,v
retrieving revision 1.32
diff -u -r1.32 gxccache.c
--- src/gxccache.c      4 Aug 2004 23:33:29 -0000       1.32
+++ src/gxccache.c      30 Mar 2005 23:13:49 -0000
@@ -337,7 +337,7 @@
        if (!cc_has_bits(cc)) {
            gx_device_memory mdev;

-           gs_make_mem_mono_device(&mdev, 0, imaging_dev);
+           gs_make_mem_mono_device(&mdev, dev->memory, imaging_dev);
            gx_open_cache_device(&mdev, cc);
            code = (*xf->common.procs->render_char) (xf, xg,
                                       (gx_device *) & mdev, cx - x, cy - y,