[Piglit] [PATCH 3/8] gles-3.0/texture-immutable-levels: Fix tex array size

Daniel Kurtz djkurtz at chromium.org
Mon Jan 6 08:02:38 PST 2014


We access tex[0] throught tex[3].
So, tex must have at least 4 elements.
This fixes a gcc warning:

warning: array subscript is above array bounds [-Warray-bounds]
  glBindTexture(GL_TEXTURE_3D, tex[3]);
                               ^

Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
 tests/spec/gles-3.0/texture-immutable-levels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/gles-3.0/texture-immutable-levels.c b/tests/spec/gles-3.0/texture-immutable-levels.c
index bccf358..c786da2 100644
--- a/tests/spec/gles-3.0/texture-immutable-levels.c
+++ b/tests/spec/gles-3.0/texture-immutable-levels.c
@@ -47,7 +47,7 @@ PIGLIT_GL_TEST_CONFIG_END
 enum piglit_result
 piglit_display(void)
 {
-	GLuint tex[3];
+	GLuint tex[4];
 	GLint level;
 
 	/* The GL ES 3.0 spec says:
-- 
1.8.5.1



More information about the Piglit mailing list