tgsi: Verify constants are set before attempting to read them.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Wed, 10 Sep 2008 01:32:52 +0000 (10:32 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Wed, 10 Sep 2008 01:32:52 +0000 (10:32 +0900)
src/gallium/auxiliary/tgsi/tgsi_exec.c

index fb573fe1f0c1b6f54f063e33b8bb567526d14e53..df002939c6bd0d5806d95da79614c7f030633ba6 100644 (file)
@@ -957,6 +957,7 @@ fetch_src_file_channel(
    case TGSI_EXTSWIZZLE_W:
       switch( file ) {
       case TGSI_FILE_CONSTANT:
+         assert(mach->Consts);
          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];