Avoid hanging if glGetIntegerv() fails.
authorJason Barron <jason.barron@nokia.com>
Mon, 3 Sep 2012 08:42:27 +0000 (10:42 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 21 Sep 2012 08:55:38 +0000 (10:55 +0200)
If 'count' is not initialized, it could be anything and if the
call to glGetIntegerv() fails and leaves this value unchanged
then the loop could go through any number of iterations.

Change-Id: Ibdcfd018b70e265ef6aeab87a5df8c0530c653a7
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/quick/scenegraph/coreapi/qsgrenderer.cpp

index c0c9084..28415cf 100644 (file)
@@ -256,7 +256,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
 #ifndef QT_NO_DEBUG
     // Sanity check that attribute registers are disabled
     {
-        GLint count;
+        GLint count = 0;
         glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &count);
         GLint enabled;
         for (int i=0; i<count; ++i) {