From: alba...@wco.com (Al Petrofsky) Subject: bug in display of interpolated images on X11 device Date: 1997/03/28 Message-ID: <87g1xgz74o.fsf@albatros.wco.com>#1/1 X-Deja-AN: 229396559 Sender: a...@albatros.wco.com X-Server-Date: 28 Mar 1997 09:40:58 GMT Organization: The Vegetable Liberation Front x-gateway: relay5.UU.NET from bug-ghostscript to gnu.ghostscript.bug; Sun, 30 Mar 1997 01:53:26 EST Newsgroups: gnu.ghostscript.bug Ghostscript version: 4.03 Where you got Ghostscript: ftp.cs.wisc.edu Hardware you are using: i586 PC Operating system you are using: Debian 1.2 Linux, kernel 2.0.27 (If you compiled Ghostscript yourself) C compiler you are using (including compiler version): gcc 2.7.2.1 Environment variables (GS_DEVICE, GS_FONTPATH, GS_LIB, GS_OPTIONS): Command line: gs interpolated.ps URL or FTP location of test file(s), if relevant: http://www.wco.com/~albatros/interpolated.ps (Use as much space as you need for the remaining items.) Symptoms: Segmentation fault in XPutImage, called from x_copy_color in gdevx.c I am using XFree86 3.2 (X11R6.1) libraries and server on a 15-bit truecolor display. Suggested fix (if any): I'm not sure what the fix is, but the following code (from x_copy_color in gdevx.c) creates a malformed image just before the call to XPutImage: { xdev->image.width = raster << 3; xdev->image.height = h; xdev->image.format = ZPixmap; xdev->image.data = (char *)base; xdev->image.depth = depth; xdev->image.bytes_per_line = raster; xdev->image.bits_per_pixel = depth; XPutImage(xdev->dpy, xdev->dest, xdev->gc, &xdev->image, sourcex, 0, x, y, w, h); This makes image.width eight times as big as image.bytes_per_line, which only makes sense if depth is 1. The width should be at most (bytes_per_line * 8 / bits_per_pixel). Other comments: