diff options
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 1a1f0d37f7..e163191c6e 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -110,8 +110,9 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) if (image.width() < m_atlas_size_limit && image.height() < m_atlas_size_limit) { if (!m_atlas) m_atlas = new Atlas(m_atlas_size); + // t may be null for atlas allocation failure t = m_atlas->create(image); - if (!hasAlphaChannel && t->hasAlphaChannel()) + if (t && !hasAlphaChannel && t->hasAlphaChannel()) t->setHasAlphaChannel(false); } return t; |