summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-08-11 13:47:40 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:06:44 (GMT)
commitea91e57e1b8136dd00683f5eb89c005198f46829 (patch)
treebae8d95d39b8d4a6a69c967243bccd7f711ea4e5
parentef3631084d3a1db48f1ee4ddecda337c352787ca (diff)
downloadQt-ea91e57e1b8136dd00683f5eb89c005198f46829.zip
Qt-ea91e57e1b8136dd00683f5eb89c005198f46829.tar.gz
Qt-ea91e57e1b8136dd00683f5eb89c005198f46829.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 07c73c3..24a7cd8 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))) {