From: Brian Paul Date: Wed, 5 Nov 2008 20:55:56 +0000 (-0700) Subject: gallium: added some sanity check assertions for constant buffer indexing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a137f03c56688c190f3542fb6b7c9a4ff4c80cff;p=mesa.git gallium: added some sanity check assertions for constant buffer indexing --- diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index df002939c6b..ea5a44fb8ab 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];