summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-08-11 13:47:40 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-09-01 03:55:26 (GMT)
commite7fdd521d5541ca6be6a50d7626410845c87a805 (patch)
tree539efdf4f040034d865f5f46eecbfc76c6b7732d
parent83cd3ec6422955276d6b9757722d17f366149fd6 (diff)
downloadQt-e7fdd521d5541ca6be6a50d7626410845c87a805.zip
Qt-e7fdd521d5541ca6be6a50d7626410845c87a805.tar.gz
Qt-e7fdd521d5541ca6be6a50d7626410845c87a805.tar.bz2
Crash in QX11PaintEngine::drawPixmap
We receive a pixmap as a const reference and then we convert it to an X11 pixmap. This conversion could fail for many reasons, however we were not looking at the result of this conversion. This patch was contributed by Christoph Feck from KDE. Task-number: QTBUG-12826 Reviewed-by: Samuel (cherry picked from commit 8e7fb343372acd0bc5fe04db7a5c5542541d4538)
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 910b2df..fecf25f 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1916,6 +1916,8 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect
int sh = qRound(sr.height());
QPixmap pixmap = qt_toX11Pixmap(px);
+ if(pixmap.isNull())
+ return;
if ((d->xinfo && d->xinfo->screen() != pixmap.x11Info().screen())
|| (pixmap.x11Info().screen() != DefaultScreen(X11->display))) {