Commit 12e35680 authored by Maciej Sitarz's avatar Maciej Sitarz Committed by Rex Dieter

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

Summary:
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:
https://bugs.kde.org/show_bug.cgi?id=355463
https://bugs.kde.org/show_bug.cgi?id=359664
https://bugzilla.redhat.com/show_bug.cgi?id=1497829

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9732
parent 1c8eb7a7
......@@ -270,7 +270,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