diff options
author | Florian Bruhin <git@the-compiler.org> | 2016-09-25 22:11:12 +0200 |
---|---|---|
committer | Florian Bruhin <qt-project.org@the-compiler.org> | 2016-09-26 08:11:59 +0000 |
commit | 79121a0827df365468a02db20179d2c2d5ae720d (patch) | |
tree | c584d73891dd6ef3b0ca82fcd246b5e2bc11576d /src/quick/scenegraph/qsgcontext.cpp | |
parent | f5e2783acec1f46070330fc1ce90cb16901a5533 (diff) |
QSGRenderContext: Add null-checks for strings
On some systems, glGetString returns null for some reason, which causes
a segfault here. Let's assume it's not one of the broken configurations
and hope for the best instead.
Task-number: QTCREATORBUG-15992
Task-number: QTBUG-56165
Change-Id: I83867e42f0fd8f576bf51ac0a2213e1348111ffd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index be228e87c7..2580809b27 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -625,12 +625,12 @@ void QSGRenderContext::initialize(QOpenGLContext *context) #ifdef Q_OS_LINUX const char *vendor = (const char *) funcs->glGetString(GL_VENDOR); - if (strstr(vendor, "nouveau")) + if (vendor && strstr(vendor, "nouveau")) m_brokenIBOs = true; const char *renderer = (const char *) funcs->glGetString(GL_RENDERER); - if (strstr(renderer, "llvmpipe")) + if (renderer && strstr(renderer, "llvmpipe")) m_serializedRender = true; - if (strstr(vendor, "Hisilicon Technologies") && strstr(renderer, "Immersion.16")) + if (vendor && renderer && strstr(vendor, "Hisilicon Technologies") && strstr(renderer, "Immersion.16")) m_brokenIBOs = true; #endif |