Mesa (gallium-0.1): gallium: added some sanity check assertions for constant buffer indexing

Brian Paul brianp at kemper.freedesktop.org
Wed Nov 5 22:38:30 UTC 2008


Module: Mesa
Branch: gallium-0.1
Commit: a137f03c56688c190f3542fb6b7c9a4ff4c80cff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a137f03c56688c190f3542fb6b7c9a4ff4c80cff

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Wed Nov  5 13:55:56 2008 -0700

gallium: added some sanity check assertions for constant buffer indexing

---

 src/gallium/auxiliary/tgsi/tgsi_exec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index df00293..ea5a44f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -958,6 +958,10 @@ fetch_src_file_channel(
       switch( file ) {
       case TGSI_FILE_CONSTANT:
          assert(mach->Consts);
+         assert(index->i[0] >= 0);
+         assert(index->i[1] >= 0);
+         assert(index->i[2] >= 0);
+         assert(index->i[3] >= 0);
          chan->f[0] = mach->Consts[index->i[0]][swizzle];
          chan->f[1] = mach->Consts[index->i[1]][swizzle];
          chan->f[2] = mach->Consts[index->i[2]][swizzle];




More information about the mesa-commit mailing list