aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@qt.io>2016-07-14 08:55:08 +0300
committerJoni Poikelin <joni.poikelin@qt.io>2016-07-15 03:58:59 +0000
commit50cc3c20047b88e763dc21ec3c5d8b28c7ecb2d4 (patch)
treed2f940eada4434ffb4a7eab852a4a0d1cb228c4c /src
parenta1f6409d1c34238405bbd73d067a39091bf844f7 (diff)
Avoid crashing when failing to query GL_EXTENSIONS
Change-Id: Ice542d53c4eb9f34745e2d06dd03c32de7a9817e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp4
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