[Piglit] [PATCH] getteximage-formats: Ensure texel is initialized.

Vinson Lee vlee at freedesktop.org
Sat Dec 8 22:15:36 PST 2012


Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/texturing/getteximage-formats.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/texturing/getteximage-formats.c b/tests/texturing/getteximage-formats.c
index 2901ec9..c053b7c 100644
--- a/tests/texturing/getteximage-formats.c
+++ b/tests/texturing/getteximage-formats.c
@@ -272,6 +272,12 @@ compute_expected_color(const struct format_desc *fmt,
 				texel[2] = 0.0;
 				texel[3] = 1.0;
 			}
+		} else {
+			assert(0);
+			texel[0] = 0.0;
+			texel[1] = 0.0;
+			texel[2] = 0.0;
+			texel[3] = 0.0;
 		}
 
 		(void) baseFormat;  /* not used, at this time */
-- 
1.8.0.1



More information about the Piglit mailing list