From ef4cf6585a61a00e33091277217b6346a1e6e7fd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 18 Feb 2014 18:47:03 +0100 Subject: 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 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickimage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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. -- cgit v1.2.3