summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-10-15 13:23:30 +0100
committerKeith Whitwell <[email protected]>2010-10-15 14:49:13 +0100
commitac98519c4eed0daf770a9ba380056978e4420352 (patch)
treeee4350ec2db6a2bba5bda2afa3fc64d9e6284302
parentffab84c9a27a229e6fa14c3de63868bb843c0f3e (diff)
llvmpipe: validate color outputs against key->nr_cbufs
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index c4b1b868b65..c070b55d3d1 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -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) {