From c2baf45c73beaa01df91d466296fd4efca25ee7a Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Sat, 18 Feb 2012 20:05:53 +0000 Subject: Prevent stack corruption when using OpenGL Core Profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qgl.cpp') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 836e7225be..31d6064e90 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4680,7 +4680,7 @@ QPaintEngine *QGLWidget::paintEngine() const return qt_qgl_paint_engine(); } -typedef GLubyte * (*qt_glGetStringi)(GLenum, GLuint); +typedef const GLubyte * (QGLF_APIENTRYP qt_glGetStringi)(GLenum, GLuint); #ifndef GL_NUM_EXTENSIONS #define GL_NUM_EXTENSIONS 0x821D -- cgit v1.2.3