diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-01-30 16:17:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-09 17:59:23 +0100 |
commit | 98a286cbdecd54e758c7e3ab60fd6e8856b15da0 (patch) | |
tree | 0afef5a9feb77464b1b56a1be6cea5f36057df94 /src/gui/image | |
parent | 137906da8e745a96c64c8120d25ff8845d82fcda (diff) |
Fix segfault when setting a device-pixel-ratio on a null-QPixmap
Change-Id: If3680766a50d5cf78889822d740c9472123191a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |