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>
This commit is contained in:
Tor Arne Vestbø 2013-01-30 16:17:35 +01:00 committed by The Qt Project
parent 137906da8e
commit 98a286cbde

View File

@ -678,6 +678,9 @@ qreal QPixmap::devicePixelRatio() const
*/
void QPixmap::setDevicePixelRatio(qreal scaleFactor)
{
if (isNull())
return;
detach();
data->setDevicePixelRatio(scaleFactor);
}