rendermode-feedback: fix a crash

Submitted by Marek Olšák on May 25, 2019, 12:49 a.m.

Details

Message ID 20190525004942.2711-1-maraeo@gmail.com
State New
Headers show
Series "rendermode-feedback: fix a crash" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák May 25, 2019, 12:49 a.m.
From: Marek Olšák <marek.olsak@amd.com>

For some reason, the last element is uninitialized if I don't clear
the structure like this.
---
 tests/spec/gl-1.0/rendermode-feedback.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/gl-1.0/rendermode-feedback.c b/tests/spec/gl-1.0/rendermode-feedback.c
index 2260370a3..3a46ab4b7 100644
--- a/tests/spec/gl-1.0/rendermode-feedback.c
+++ b/tests/spec/gl-1.0/rendermode-feedback.c
@@ -94,28 +94,27 @@  struct type {
 	  ARRAY_SIZE(gl_4d_color_texture_values) },
 };
 
 static enum piglit_result run_subtest(void * data);
 static const struct piglit_gl_test_config * piglit_config;
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	piglit_config = &config;
 
-	struct piglit_subtest tests[ARRAY_SIZE(types) + 1];
+	struct piglit_subtest tests[ARRAY_SIZE(types) + 1] = {};
 	for (unsigned i = 0; i < ARRAY_SIZE(types); ++i) {
 		tests[i].name = piglit_get_gl_enum_name(types[i].type);
 		tests[i].option = tests[i].name;
 		tests[i].subtest_func = run_subtest;
 		tests[i].data = (void *)&types[i];
 	}
-	tests[ARRAY_SIZE(types)] = (struct piglit_subtest){ 0 };
 	config.subtests = tests;
 
 	config.supports_gl_compat_version = 10;
 
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
 	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static void