[Mesa-dev] [PATCH] draw: Ensure channel in convert_to_soa is initialized.

Vinson Lee vlee at freedesktop.org
Thu Aug 2 22:47:52 PDT 2012


Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/gallium/auxiliary/draw/draw_llvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 8d9b530..3400661 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -559,7 +559,7 @@ convert_to_soa(struct gallivm_state *gallivm,
       unsigned pixels_per_channel = soa_type.length / TGSI_NUM_CHANNELS;
 
       for (j = 0; j < TGSI_NUM_CHANNELS; ++j) {
-         LLVMValueRef channel[LP_MAX_VECTOR_LENGTH];
+         LLVMValueRef channel[LP_MAX_VECTOR_LENGTH] = { 0 };
 
          assert(pixels_per_channel <= LP_MAX_VECTOR_LENGTH);
 
-- 
1.7.11.1



More information about the mesa-dev mailing list