aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-16 17:41:44 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-11-17 18:15:09 +0000
commit08778586413adad7b3af35c7cb97416757d599c0 (patch)
tree7f127bbb1a46906789d7f149d06b2ca4bf3022bd
parentd188cdd7378e0e8b384fa812b5907638075d1206 (diff)
Fix crash when accessing pixmap on default QSGSoftwareInternalImageNodev5.9.3
Task-number: QTBUG-64562 Change-Id: I52e07b0d8b7a5d1cc960431dcbd1a90dd3e7e518 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
index 10291b9cb5..8843b6450a 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
@@ -490,12 +490,13 @@ QRectF QSGSoftwareInternalImageNode::rect() const
const QPixmap &QSGSoftwareInternalImageNode::pixmap() const
{
- if (QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(m_texture)) {
+ if (QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(m_texture))
return pt->pixmap();
- } else {
- QSGSoftwareLayer *layer = qobject_cast<QSGSoftwareLayer*>(m_texture);
+ if (QSGSoftwareLayer *layer = qobject_cast<QSGSoftwareLayer*>(m_texture))
return layer->pixmap();
- }
+ Q_ASSERT(m_texture == 0);
+ static const QPixmap nullPixmap;
+ return nullPixmap;
}
QT_END_NAMESPACE