gallium: added some sanity check assertions for constant buffer indexing
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 5 Nov 2008 20:55:56 +0000 (13:55 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 5 Nov 2008 20:55:56 +0000 (13:55 -0700)
src/gallium/auxiliary/tgsi/tgsi_exec.c

index df002939c6bd0d5806d95da79614c7f030633ba6..ea5a44fb8ab8110badc6ec56bcdde5787f2bf7f6 100644 (file)
@@ -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];