Skip to content

Commit

Permalink
Fix for uninitialized local variable
Browse files Browse the repository at this point in the history
This patch initializes a local GLuint that gets
checked after an if() chain that assigns it but
does not match all cases.

Change-Id: I132c26fa944f11c7b77131906ff8143a7b57c10f
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
alpqr authored and paoletto committed Oct 5, 2016
1 parent fe2ddd8 commit 978cb5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/opengl/qopenglshaderprogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ bool QOpenGLShaderPrivate::create()
QOpenGLContext *context = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
if (!context)
return false;
GLuint shader;
GLuint shader = 0;
if (shaderType == QOpenGLShader::Vertex) {
shader = glfuncs->glCreateShader(GL_VERTEX_SHADER);
} else if (shaderType == QOpenGLShader::Geometry && supportsGeometryShaders) {
Expand Down

0 comments on commit 978cb5d

Please sign in to comment.