From 1d01429c6a1ae679d0cc0cb61db1948fca5ced4c Mon Sep 17 00:00:00 2001 From: Mathias Fröhlich Date: Sat, 28 Jan 2012 18:55:08 +0100 Subject: state_stracker: Fix access to uninitialized memory. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix an access to uninitialized memory pointed out by valgrind in glsl_to_tgsi_visitor::simplify_cmp(void). Note: This is a candidate for the 8.0 branch. Signed-off-by: Mathias Fröhlich --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 188e8d9d5c9..ab05896ce45 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -2978,7 +2978,7 @@ glsl_to_tgsi_visitor::simplify_cmp(void) if (!tempWrites) { return; } - memset(tempWrites, 0, sizeof(tempWrites)); + memset(tempWrites, 0, sizeof(unsigned) * MAX_TEMPS); memset(outputWrites, 0, sizeof(outputWrites)); foreach_iter(exec_list_iterator, iter, this->instructions) { -- cgit v1.2.3