Module: Mesa
Branch: master
Commit: fcd6b3f42be904d162b78fe75ba14c6415cdb815
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fcd6b3f42be904d162b78fe75ba14c6415cdb815

Author: Rob Clark <robcl...@freedesktop.org>
Date:   Wed May 18 10:38:40 2016 -0400

nir: coverity unitialized pointer read

Not sure how coverity arrives at the conclusion that we can read comp[j]
unitialized (around line 204), other than not being aware that ncomp is
greater than 1 so it won't underflow in the 'if (tex->is_array)' case.

Signed-off-by: Rob Clark <robcl...@freedesktop.org>
Reviewed-by: Matt Turner <matts...@gmail.com>

---

 src/compiler/nir/nir_lower_tex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index a080475..2086263 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -177,6 +177,8 @@ saturate_src(nir_builder *b, nir_tex_instr *tex, unsigned 
sat_mask)
       /* split src into components: */
       nir_ssa_def *comp[4];
 
+      assume(tex->coord_components >= 1);
+
       for (unsigned j = 0; j < tex->coord_components; j++)
          comp[j] = nir_channel(b, src, j);
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to