summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2017-04-28 10:36:11 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2017-05-16 10:03:07 +0000
commitbfb5627c3426ac60223c0fe422e707013598d129 (patch)
treec6dc9eecb77ce607f6b2c9e6b4946081237e696c
parent4b3f368aba47d559040c3f038620883462b925ea (diff)
Renderer: prevent crash in case texture failed to be built
This can occur if a TextureLoader fails to load (wrong path, access denied ...) Change-Id: I55b62312db79db3980146bb17cbadbe5c66d7a48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/texture/gltexture.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/render/texture/gltexture.cpp b/src/render/texture/gltexture.cpp
index a2e0dc5d0..606681bd5 100644
--- a/src/render/texture/gltexture.cpp
+++ b/src/render/texture/gltexture.cpp
@@ -188,6 +188,8 @@ QOpenGLTexture* GLTexture::getOrCreateGLTexture()
if (!m_gl) {
m_gl = buildGLTexture();
+ if (!m_gl)
+ return nullptr;
m_gl->allocateStorage();
if (!m_gl->isStorageAllocated()) {
qWarning() << Q_FUNC_INFO << "texture storage allocation failed";