summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorculler <culler>2021-04-30 19:13:17 (GMT)
committerculler <culler>2021-04-30 19:13:17 (GMT)
commit0c96fec6cef8ca37727111c74c448f0609044303 (patch)
tree620b1a5107c0d5c14d98a52e6042b94697ae1445 /xlib
parenta723a9e97cc86c5cbee7c26aca2d344ad18c12a1 (diff)
downloadtk-0c96fec6cef8ca37727111c74c448f0609044303.zip
tk-0c96fec6cef8ca37727111c74c448f0609044303.tar.gz
tk-0c96fec6cef8ca37727111c74c448f0609044303.tar.bz2
Fix [ff9c815a83]: 8 Aqua unixWm tests fail if the dock is positioned on the left side. Also fixes a segfault at exit in ximage.c.
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;
}