summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-09-29 11:29:11 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-10-05 11:28:05 +0000
commit978cb5d3ce05748f5707f0c2c58e698f11e6ef89 (patch)
tree3d1b1f8f207b9481578b6d939f47ff17776b4510
parentfe2ddd8ba425d3f92b59be3885f57ddca592441d (diff)
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 <edward.welbourne@qt.io>
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 6f5aff14aa..1ed5f7317a 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 *>(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) {