From: Mathias Fröhlich Date: Sat, 28 Jan 2012 17:55:08 +0000 (+0100) Subject: state_stracker: Fix access to uninitialized memory. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d01429c6a1ae679d0cc0cb61db1948fca5ced4c;p=mesa.git state_stracker: Fix access to uninitialized memory. 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 --- 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) {