draw: Ensure channel in convert_to_soa is initialized.
authorVinson Lee <vlee@freedesktop.org>
Fri, 3 Aug 2012 05:38:24 +0000 (22:38 -0700)
committerVinson Lee <vlee@freedesktop.org>
Sat, 4 Aug 2012 05:28:31 +0000 (22:28 -0700)
Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c

index 8d9b530..3400661 100644 (file)
@@ -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);