QmlDesigner: Crash fix

This is likely to fix a crash we could only reproduce
with the Qt Design Studio release on one machine.

Task-number: QDS-270
Change-Id: Idc33ba145169613b866903fa5e259f8cd6ec4ee8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2018-10-29 09:18:38 +01:00
parent 5b7e0afc10
commit 9ab3a69c65

View File

@@ -196,7 +196,10 @@ static void readSharedMemory(qint32 key, ImageContainer &container)
QImage image = QImage(imageWidth, imageHeight, QImage::Format(imageFormat)); QImage image = QImage(imageWidth, imageHeight, QImage::Format(imageFormat));
std::memcpy(image.bits(), reinterpret_cast<const qint32*>(sharedMemory.constData()) + 5, byteCount); if (image.isNull())
qDebug() << Q_FUNC_INFO << "Not able to create image:" << imageWidth << imageHeight << imageFormat;
else
std::memcpy(image.bits(), reinterpret_cast<const qint32*>(sharedMemory.constData()) + 5, byteCount);
container.setImage(image); container.setImage(image);