summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_copy_propagation_elements.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-08-28 15:33:56 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-09-03 17:25:56 -0700
commit5ced83ee1561553d9eba831fa356bf63cc214447 (patch)
treecc53c0d3ddbcc01d5f338dc7b3c68b2b1ab1b7ba /src/glsl/opt_copy_propagation_elements.cpp
parent8270b048cf23ee8a8d5377a3af62fce7086e9c61 (diff)
downloadexternal_mesa3d-5ced83ee1561553d9eba831fa356bf63cc214447.zip
external_mesa3d-5ced83ee1561553d9eba831fa356bf63cc214447.tar.gz
external_mesa3d-5ced83ee1561553d9eba831fa356bf63cc214447.tar.bz2
glsl: Initialize source_chan in opt_copy_propagation_elements.
Previously, if chans < 4, we passed uninitialized stack garbage to the ir_swizzle constructor for the excess components. Thankfully, it ignores that data, as it's unnecessary, so no harm actually comes of it. However, it's obviously better to initialize it. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/glsl/opt_copy_propagation_elements.cpp')
-rw-r--r--src/glsl/opt_copy_propagation_elements.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/opt_copy_propagation_elements.cpp b/src/glsl/opt_copy_propagation_elements.cpp
index f5f59b7..f131894 100644
--- a/src/glsl/opt_copy_propagation_elements.cpp
+++ b/src/glsl/opt_copy_propagation_elements.cpp
@@ -207,7 +207,7 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
int swizzle_chan[4];
ir_dereference_variable *deref_var;
ir_variable *source[4] = {NULL, NULL, NULL, NULL};
- int source_chan[4];
+ int source_chan[4] = {0, 0, 0, 0};
int chans;
if (!*ir)