From 98a286cbdecd54e758c7e3ab60fd6e8856b15da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 30 Jan 2013 16:17:35 +0100 Subject: [PATCH] Fix segfault when setting a device-pixel-ratio on a null-QPixmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If3680766a50d5cf78889822d740c9472123191a7 Reviewed-by: Tor Arne Vestbø --- src/gui/image/qpixmap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 852025117b..ed477e767b 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -678,6 +678,9 @@ qreal QPixmap::devicePixelRatio() const */ void QPixmap::setDevicePixelRatio(qreal scaleFactor) { + if (isNull()) + return; + detach(); data->setDevicePixelRatio(scaleFactor); }