summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorculler <culler>2021-05-02 03:52:13 (GMT)
committerculler <culler>2021-05-02 03:52:13 (GMT)
commitea7932318beff09d02dfff2e9c0cf9aef442931d (patch)
treee35a3187c91d40b0d480c90262036d3c1fdefab5 /xlib
parentdad9cd1095e2186936703566688f5e4f3b1caab8 (diff)
parentfb33aecc60cd7d9d60572995c74fa13247f4e4ba (diff)
downloadtk-ea7932318beff09d02dfff2e9c0cf9aef442931d.zip
tk-ea7932318beff09d02dfff2e9c0cf9aef442931d.tar.gz
tk-ea7932318beff09d02dfff2e9c0cf9aef442931d.tar.bz2
Merge 8.6
Diffstat (limited to 'xlib')
-rw-r--r--xlib/ximage.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xlib/ximage.c b/xlib/ximage.c
index aaab946..b3a8f20 100644
--- a/xlib/ximage.c
+++ b/xlib/ximage.c
@@ -51,11 +51,13 @@ XCreateBitmapFromData(
}
ximage = XCreateImage(display, NULL, 1, XYBitmap, 0, (char*) data, width,
height, 8, (width + 7) / 8);
- ximage->bitmap_bit_order = LSBFirst;
- _XInitImageFuncPtrs(ximage);
- TkPutImage(NULL, 0, display, pix, gc, ximage, 0, 0, 0, 0, width, height);
- ximage->data = NULL;
- XDestroyImage(ximage);
+ if (ximage) {
+ ximage->bitmap_bit_order = LSBFirst;
+ _XInitImageFuncPtrs(ximage);
+ TkPutImage(NULL, 0, display, pix, gc, ximage, 0, 0, 0, 0, width, height);
+ ximage->data = NULL;
+ XDestroyImage(ximage);
+ }
XFreeGC(display, gc);
return pix;
}