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:
parent
137906da8e
commit
98a286cbde
@ -678,6 +678,9 @@ qreal QPixmap::devicePixelRatio() const
|
|||||||
*/
|
*/
|
||||||
void QPixmap::setDevicePixelRatio(qreal scaleFactor)
|
void QPixmap::setDevicePixelRatio(qreal scaleFactor)
|
||||||
{
|
{
|
||||||
|
if (isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
detach();
|
detach();
|
||||||
data->setDevicePixelRatio(scaleFactor);
|
data->setDevicePixelRatio(scaleFactor);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user