summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-09-20 15:34:02 -0600
committerBrian Paul <[email protected]>2010-09-20 15:34:02 -0600
commit77af10955462819d973a395270777c5b8217f6ae (patch)
tree0ca80dfde8e525b817ba1d4ffd36639df853a94a
parent1662c317032cf280701d7e55b028b7f0dc8afc65 (diff)
draw: check bitshift against PIPE_MAX_SHADER_OUTPUS
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_wide_point.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index 40843c58c20..3646c6a7145 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -237,7 +237,11 @@ widepoint_first_point(struct draw_stage *stage,
for (i = 0; i < fs->info.num_inputs; i++) {
if (fs->info.input_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
const int generic_index = fs->info.input_semantic_index[i];
- if (rast->sprite_coord_enable & (1 << generic_index)) {
+ /* Note that sprite_coord enable is a bitfield of
+ * PIPE_MAX_SHADER_OUTPUTS bits.
+ */
+ if (generic_index < PIPE_MAX_SHADER_OUTPUTS &&
+ (rast->sprite_coord_enable & (1 << generic_index))) {
/* OK, this generic attribute needs to be replaced with a
* texcoord (see above).
*/