X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fglyphs-x.c;h=6d5f7506b3bba6ce2be8ecb7e0f51f4f82401748;hp=aed51bf4514faf9cab2fb061a5f7dfa1c11792d9;hb=28a3fa29bc0bd9a124b6e3379e82d62e815c22a2;hpb=cfe4120f7310b0d3a0a186a91c9e18efe6b1320f diff --git a/src/glyphs-x.c b/src/glyphs-x.c index aed51bf..6d5f750 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -124,7 +124,7 @@ convert_EImage_to_XImage (Lisp_Object device, int width, int height, Colormap cmap; Visual *vis; XImage *outimg; - int depth, bitmap_pad, byte_cnt, i, j; + int depth, bitmap_pad, bits_per_pixel, byte_cnt, i, j; int rd,gr,bl,q; unsigned char *data, *ip, *dp; quant_table *qtable = 0; @@ -149,13 +149,15 @@ convert_EImage_to_XImage (Lisp_Object device, int width, int height, bitmap_pad = ((depth > 16) ? 32 : (depth > 8) ? 16 : 8); - byte_cnt = bitmap_pad >> 3; outimg = XCreateImage (dpy, vis, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!outimg) return NULL; + bits_per_pixel = outimg->bits_per_pixel; + byte_cnt = bits_per_pixel >> 3; + data = (unsigned char *) xmalloc (outimg->bytes_per_line * height); if (!data) {