diff options
author | Sean Harmer <[email protected]> | 2012-02-18 20:05:53 +0000 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2012-02-28 00:29:04 +0100 |
commit | c2baf45c73beaa01df91d466296fd4efca25ee7a (patch) | |
tree | 584396a924cea33e5be5e3fff337f148d3988f6a /src/gui/opengl/qopengl.cpp | |
parent | 394e45199fa1aa45036dd787c5052ef7bcd98c52 (diff) |
Prevent stack corruption when using OpenGL Core Profile
When an OpenGL Core Profile context is requested the function
glGetStringi() is used to query the supported extensions as
glGetString(GL_EXTENSIONS) has been removed in the core profile.
The signature for glGetStringi used in Qt missed off the APIENTRY calling
convention. This results in stack corruption on windows each time
glGetStringi() is called leading to a crash.
Change-Id: Iff62c42e2bb5fc4a5c0561fae97ddc5a8ae3a45e
Reviewed-by: Samuel Rødal <[email protected]>
Diffstat (limited to 'src/gui/opengl/qopengl.cpp')
-rw-r--r-- | src/gui/opengl/qopengl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index f39dc122393..290fcb287ea 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -42,6 +42,7 @@ #include "qopengl_p.h" #include "qopenglcontext.h" +#include "qopenglfunctions.h" QT_BEGIN_NAMESPACE @@ -50,7 +51,7 @@ QOpenGLExtensionMatcher::QOpenGLExtensionMatcher(const char *str) init(str); } -typedef GLubyte * (*qt_glGetStringi)(GLenum, GLuint); +typedef const GLubyte * (QOPENGLF_APIENTRYP qt_glGetStringi)(GLenum, GLuint); #ifndef GL_NUM_EXTENSIONS #define GL_NUM_EXTENSIONS 0x821D |