diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2016-10-28 12:12:05 +0200 |
---|---|---|
committer | Jesus Fernandez <jesus.fernandez@qt.io> | 2016-11-07 10:54:58 +0000 |
commit | fe98037e76d95e7634cce3c96878956edd2f61fa (patch) | |
tree | 96edc8b937c2fe5b58981dbcf50552060e6d4d9c | |
parent | 9bfe3324f7fa94e1f272c35bcb943daa2669edba (diff) |
Fix crash when using custom OpenGL functions
The code was using the ::glGetString function and this could fail
if we are using a custom platform plugin.
Change-Id: Idb9ccd178ea52255b9d6f0f6d3fd529094c15292
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/particles/qquickimageparticle.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index d78a350306..f3feb91ffa 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -1276,14 +1276,16 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node) // OS X 10.8.3 introduced a bug in the AMD drivers, for at least the 2011 macbook pros, // causing point sprites who read gl_PointCoord in the frag shader to come out as // green-red blobs. - if (perfLevel < Deformable && strstr((char *) glGetString(GL_VENDOR), "ATI")) { + const GLubyte *glVendor = QOpenGLContext::currentContext()->functions()->glGetString(GL_VENDOR); + if (perfLevel < Deformable && glVendor && strstr((char *) glVendor, "ATI")) { perfLevel = Deformable; } #endif #ifdef Q_OS_LINUX // Nouveau drivers can potentially freeze a machine entirely when taking the point-sprite path. - if (perfLevel < Deformable && strstr((const char *) glGetString(GL_VENDOR), "nouveau")) + const GLubyte *glVendor = QOpenGLContext::currentContext()->functions()->glGetString(GL_VENDOR); + if (perfLevel < Deformable && glVendor && strstr((const char *) glVendor, "nouveau")) perfLevel = Deformable; #endif |