llvmpipe: validate color outputs against key->nr_cbufs

This commit is contained in:
Keith Whitwell 2010-10-15 13:23:30 +01:00
parent ffab84c9a2
commit ac98519c4e
1 changed files with 2 additions and 1 deletions

View File

@ -404,7 +404,8 @@ generate_fs(struct llvmpipe_context *lp,
/* Color write */
for (attrib = 0; attrib < shader->info.base.num_outputs; ++attrib)
{
if (shader->info.base.output_semantic_name[attrib] == TGSI_SEMANTIC_COLOR)
if (shader->info.base.output_semantic_name[attrib] == TGSI_SEMANTIC_COLOR &&
shader->info.base.output_semantic_index[attrib] < key->nr_cbufs)
{
unsigned cbuf = shader->info.base.output_semantic_index[attrib];
for(chan = 0; chan < NUM_CHANNELS; ++chan) {