diff options
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 1465fea8b9..d879a5cb61 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -363,10 +363,12 @@ void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageC } is_null = (w <= 0 || h <= 0); - image.d->devicePixelRatio = sourceImage.devicePixelRatio(); + if (image.d) + image.d->devicePixelRatio = sourceImage.devicePixelRatio(); //ensure the pixmap and the image resulting from toImage() have the same cacheKey(); setSerialNumber(image.cacheKey() >> 32); - setDetachNumber(image.d->detach_no); + if (image.d) + setDetachNumber(image.d->detach_no); } QImage* QRasterPlatformPixmap::buffer() |