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

Ray Johnston <[email protected]> Thu, 31 Mar 2005 12:39:23 -0800
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Artifex Software Inc.
Message-ID <[email protected]>
Dan,

This change looks fine.

I think there are similar problems in src/gdevpm.c:

     /* Finish initializing the bitmap. */

     gs_make_mem_device(&mdev, gdev_mem_device_for_bits(pmdev->color_info.depth), 0, 0, (gx_device *) pmdev);

and src/gdevwdib.c:

     /* Finish initializing the DIB. */

     gs_make_mem_device(&mdev, gdev_mem_device_for_bits(dev->color_info.depth), 0, 0, (gx_device *) dev);

and src/gxmclip.c:

     if (buffer_height > bits->size.y)
	buffer_height = bits->size.y;
     gs_make_mem_mono_device(&cdev->mdev, 0, 0);

Can you hit all of these as well ?

Regards,
Ray
________________________________________________________________________
Dan Coby wrote:

> 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,
> 
> 
> _______________________________________________
> gs-code-review mailing list
> [email protected]
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
> 
> 

-- 
Ray Johnston
Director of Engineering                          Tel: (714) 484-0376
Artifex Software Inc.                            Fax: (714) 220-1022
______________________________________________________________________