From ea91e57e1b8136dd00683f5eb89c005198f46829 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Wed, 11 Aug 2010 15:47:40 +0200 Subject: 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) --- src/gui/painting/qpaintengine_x11.cpp | 2 ++ 1 file changed, 2 insertions(+) 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))) { -- cgit v0.12