diff options
author | Joni Poikelin <joni.poikelin@qt.io> | 2016-07-14 08:55:08 +0300 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@qt.io> | 2016-07-15 03:58:59 +0000 |
commit | 50cc3c20047b88e763dc21ec3c5d8b28c7ecb2d4 (patch) | |
tree | d2f940eada4434ffb4a7eab852a4a0d1cb228c4c /src/quick/scenegraph/util/qsgatlastexture.cpp | |
parent | a1f6409d1c34238405bbd73d067a39091bf844f7 (diff) |
Avoid crashing when failing to query GL_EXTENSIONS
Change-Id: Ice542d53c4eb9f34745e2d06dd03c32de7a9817e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/util/qsgatlastexture.cpp')
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 832510148c..1a1f0d37f7 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -151,13 +151,13 @@ Atlas::Atlas(const QSize &size) wrongfullyReportsBgra8888Support = false; const char *ext = (const char *) QOpenGLContext::currentContext()->functions()->glGetString(GL_EXTENSIONS); - if (!wrongfullyReportsBgra8888Support + if (ext && !wrongfullyReportsBgra8888Support && (strstr(ext, "GL_EXT_bgra") || strstr(ext, "GL_EXT_texture_format_BGRA8888") || strstr(ext, "GL_IMG_texture_format_BGRA8888"))) { m_internalFormat = m_externalFormat = GL_BGRA; #ifdef Q_OS_IOS - } else if (strstr(ext, "GL_APPLE_texture_format_BGRA8888")) { + } else if (ext && strstr(ext, "GL_APPLE_texture_format_BGRA8888")) { m_internalFormat = GL_RGBA; m_externalFormat = GL_BGRA; #endif // IOS |