aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-18 17:49:06 +0200
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-05-18 17:49:06 +0200
commitacbc84876a39380982848036ff0f9eaadd6a0593 (patch)
tree585c734247f1544efafb36e9c536c5492ef5d73b /src
parent7ef7dd68dc66226b01ea49a081a8c106ca545cea (diff)
Fixed crash when Image/ShaderEffectSource source is missing.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/items/qsgimage.cpp10
-rw-r--r--src/declarative/items/qsgshadereffectsource.cpp8
2 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/items/qsgimage.cpp b/src/declarative/items/qsgimage.cpp
index 10670f4015..d280ef08a1 100644
--- a/src/declarative/items/qsgimage.cpp
+++ b/src/declarative/items/qsgimage.cpp
@@ -179,10 +179,12 @@ QSGTexture *QSGImage::texture() const
{
Q_D(const QSGImage);
QSGTexture *t = d->pix.texture();
- t->setFiltering(QSGItemPrivate::get(this)->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
- t->setMipmapFiltering(QSGTexture::None);
- t->setHorizontalWrapMode(QSGTexture::ClampToEdge);
- t->setVerticalWrapMode(QSGTexture::ClampToEdge);
+ if (t) {
+ t->setFiltering(QSGItemPrivate::get(this)->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
+ t->setMipmapFiltering(QSGTexture::None);
+ t->setHorizontalWrapMode(QSGTexture::ClampToEdge);
+ t->setVerticalWrapMode(QSGTexture::ClampToEdge);
+ }
return t;
}
diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp
index 199a56067e..217b0e67a7 100644
--- a/src/declarative/items/qsgshadereffectsource.cpp
+++ b/src/declarative/items/qsgshadereffectsource.cpp
@@ -206,7 +206,13 @@ void QSGShaderEffectTexture::markDirtyTexture()
void QSGShaderEffectTexture::grab()
{
- Q_ASSERT(m_item);
+ if (!m_item || m_size.isNull()) {
+ delete m_fbo;
+ delete m_secondaryFbo;
+ m_fbo = m_secondaryFbo = 0;
+ m_dirtyTexture = false;
+ return;
+ }
QSGNode *root = m_item;
while (root->childCount() && root->type() != QSGNode::RootNodeType)
root = root->childAtIndex(0);