diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2018-10-29 09:18:38 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2018-10-29 11:45:30 +0000 |
commit | 9ab3a69c652575b03158ba09bc63fcb18ca3b3f7 (patch) | |
tree | acbf79795a55afe557d333b9419151167e421445 /share | |
parent | 5b7e0afc10032dc14aa617cacce8469ec9994289 (diff) | |
download | qt-creator-9ab3a69c652575b03158ba09bc63fcb18ca3b3f7.tar.gz |
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>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp index 798e448108..f36a1d5efb 100644 --- a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp @@ -196,7 +196,10 @@ static void readSharedMemory(qint32 key, ImageContainer &container) 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); |