From c7ccf3136e3d62e6d310fb538eefe591c43c7942 Mon Sep 17 00:00:00 2001 From: James Helferty Date: Thu, 27 Jul 2017 11:37:55 -0400 Subject: [PATCH] Initialize variables for error tests This set of tests intentionally provides erroneous call arguments in order to generate GL errors. As a result, the GL functions' output arguments won't always be written to. The problem is, we bounce these functions through CallLogWrapper, which expects the output arguments to have valid contents, and will attempt to log them to file, potentially resulting in unexpected process termination. This change initializes the output arguments beforehand to valid values so that CallLogWrapper doesn't unintentionally access invalid memory. VK-GL-CTS issue 603 Components: OpenGL Affects: * KHR-GLES31.core.program_interface_query.invalid-enum * KHR-GLES31.core.program_interface_query.invalid-operation * KHR-GLES31.core.program_interface_query.invalid-value * KHR-GL43/44/45.program_interface_query.invalid-enum * KHR-GL43/44/45.program_interface_query.invalid-operation * KHR-GL43/44/45.program_interface_query.invalid-value Change-Id: I5fae2d4505e9c70cbcb2fbd11bdf900c0b4c751a --- .../openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/external/openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp b/external/openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp index 8bfd856..648aea0 100644 --- a/external/openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp +++ b/external/openglcts/modules/gl/gl4cProgramInterfaceQueryTests.cpp @@ -2748,8 +2748,8 @@ class InvalidValueTest : public SimpleShaders { long error = NO_ERROR; - GLint res; - GLsizei len; + GLint res = 0; + GLsizei len = 0; GLchar name[100] = { '\0' }; GLenum props[1] = { GL_NAME_LENGTH }; @@ -2833,8 +2833,8 @@ class InvalidEnumTest : public AtomicCounterSimple long error = NO_ERROR; - GLint res; - GLsizei len; + GLint res = 0; + GLsizei len = 0; GLchar name[100] = { '\0' }; GLenum props[1] = { GL_TEXTURE_1D }; @@ -2895,8 +2895,8 @@ class InvalidOperationTest : public SimpleShaders LinkProgram(program); const GLuint sh = glCreateShader(GL_FRAGMENT_SHADER); - GLint res; - GLsizei len; + GLint res = 0; + GLsizei len = 0; GLchar name[100] = { '\0' }; GLenum props[1] = { GL_OFFSET }; -- 2.7.4