From 978cb5d3ce05748f5707f0c2c58e698f11e6ef89 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 29 Sep 2016 11:29:11 +0200 Subject: Fix for uninitialized local variable 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 --- src/gui/opengl/qopenglshaderprogram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/opengl/qopenglshaderprogram.cpp') diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 6f5aff14aab..1ed5f7317a9 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -296,7 +296,7 @@ bool QOpenGLShaderPrivate::create() QOpenGLContext *context = const_cast(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) { -- cgit v1.2.3