Commit e2b7c395 authored by Maciej Sitarz's avatar Maciej Sitarz Committed by David Edmundson

Fix for xembedsniproxy crash due to NULL returned from xcb_image_get()

In my environment (Fedora 27, plasma-workspace-5.11.4-1.fc27.x86_64) xembedsniproxy crashes.
This is caused by NULL being returned by xcb_image_get().

This should fix or at least mitigate the problems from bugs:

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision:
parent 7878c998
......@@ -288,7 +288,13 @@ QImage SNIProxy::getImageNonComposite() const
xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, 0xFFFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP);
// Don't hook up cleanup yet, we may use a different QImage after all
QImage naiveConversion = QImage(image->data, image->width, image->height, QImage::Format_ARGB32);
QImage naiveConversion;
if (image) {
naiveConversion = QImage(image->data, image->width, image->height, QImage::Format_ARGB32);
} else {
qCDebug(SNIPROXY) << "Skip NULL image returned from xcb_image_get() for" << m_windowId << Title();
return QImage();
if (isTransparentImage(naiveConversion)) {
QImage elaborateConversion = QImage(convertFromNative(image));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment