summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-09-20 15:33:49 -0600
committerBrian Paul <[email protected]>2010-09-20 15:33:49 -0600
commit1662c317032cf280701d7e55b028b7f0dc8afc65 (patch)
treedec29f5719db084b180a753ddcb9f2b23031f84e /src
parenta7ea4d11fb5a2a39daaad8752706291ac93013f7 (diff)
llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTS
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_point.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index bb6b88069bf..774a3c80dad 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -188,8 +188,11 @@ setup_point_coefficients( struct lp_setup_context *setup,
*/
if (shader->info.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) {
const int index = shader->info.input_semantic_index[slot];
-
- if (setup->sprite_coord_enable & (1 << index)) {
+ /* Note that sprite_coord enable is a bitfield of
+ * PIPE_MAX_SHADER_OUTPUTS bits.
+ */
+ if (index < PIPE_MAX_SHADER_OUTPUTS &&
+ (setup->sprite_coord_enable & (1 << index))) {
for (i = 0; i < NUM_CHANNELS; i++)
if (usage_mask & (1 << i))
perspective_coef(setup, point, info, slot+1, vert_attr, i,