summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-08-11 15:47:40 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:06:44 +0300
commitea91e57e1b8136dd00683f5eb89c005198f46829 (patch)
treebae8d95d39b8d4a6a69c967243bccd7f711ea4e5 /src
parentef3631084d3a1db48f1ee4ddecda337c352787ca (diff)
downloadqt4-tools-ea91e57e1b8136dd00683f5eb89c005198f46829.tar.gz
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)
Diffstat (limited to 'src')
-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 07c73c31be..24a7cd87a2 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1906,6 +1906,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))) {