Fix crash when trying to access a missing texture.
authorGlenn Watson <glenn.watson@nokia.com>
Mon, 31 Oct 2011 03:06:44 +0000 (13:06 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 Nov 2011 04:13:05 +0000 (05:13 +0100)
Check for valid texture pointer before calling member function
to determine if it is part of a texture atlas.

Change-Id: Ic36ad21f79c514aa92e4c37c467fb4e5d91b4e60
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/items/qquickimage.cpp

index 0737957..11de584 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     QSGTexture *texture() const {
 
-        if (m_texture->isAtlasTexture())
+        if (m_texture && m_texture->isAtlasTexture())
             const_cast<QQuickImageTextureProvider *>(this)->m_texture = m_texture->removedFromAtlas();
 
         if (m_texture) {