[Mesa-dev] [PATCH] nouveau/codegen: Initialize dst0 array in Converter::handleInstruction.

Vinson Lee vlee at freedesktop.org
Fri Sep 27 21:00:46 PDT 2013


dst0 is not initialized if tgsi.dstCount() is false.

Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 49a45f8..5eb6a7e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2091,7 +2091,8 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
 {
    Instruction *geni;
 
-   Value *dst0[4], *rDst0[4];
+   Value *dst0[4] = { 0 };
+   Value *rDst0[4];
    Value *src0, *src1, *src2;
    Value *val0, *val1;
    int c;
-- 
1.8.3.1



More information about the mesa-dev mailing list