diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-02-18 18:47:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-19 20:13:47 +0100 |
commit | ef4cf6585a61a00e33091277217b6346a1e6e7fd (patch) | |
tree | c9f024858ecde1bfd2b6054d8fc29f942c63d62a /src | |
parent | 37bd5257da0858c134ae20847afc830e04ea68cb (diff) |
Do not add Images with invalid geometry to the scene graph.
Task-number: QTBUG-35656
Task-number: QTBUG-36050
Change-Id: Iea2d5303bdeb9c523e59ebcdc9f97288060be022
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickimage.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index b6b8a2a39b..69a39d2396 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -676,6 +676,14 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) sourceRect.width() / d->pix.width(), sourceRect.height() / d->pix.height()); + if (targetRect.isEmpty() + || !qIsFinite(targetRect.width()) || !qIsFinite(targetRect.height()) + || nsrect.isEmpty() + || !qIsFinite(nsrect.width()) || !qIsFinite(nsrect.height())) { + delete node; + return 0; + } + if (d->pixmapChanged) { // force update the texture in the node to trigger reconstruction of // geometry and the likes when a atlas segment has changed. |