From fa467bc58885e8a062a10a5a28b9ab5b9b4987db Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 30 Aug 2011 08:48:36 +0200 Subject: [PATCH] Don't create the ShaderEffect node when attributes are missing Change-Id: Ib291b9b3bbf2f421998e2c8d92e34fb88f53a5c7 Reviewed-on: http://codereview.qt.nokia.com/3848 Reviewed-by: Qt Sanity Bot Reviewed-by: Kim M. Kalland --- src/declarative/items/qsgshadereffect.cpp | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/declarative/items/qsgshadereffect.cpp b/src/declarative/items/qsgshadereffect.cpp index b66f9c1..ff13150 100644 --- a/src/declarative/items/qsgshadereffect.cpp +++ b/src/declarative/items/qsgshadereffect.cpp @@ -582,6 +582,13 @@ QSGNode *QSGShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData { QSGShaderEffectNode *node = static_cast(oldNode); + // In the case of a bad vertex shader, don't try to create a node... + if (m_source.attributeNames.isEmpty()) { + if (node) + delete node; + return 0; + } + if (!node) { node = new QSGShaderEffectNode; m_programDirty = true; -- 1.7.2.5