*/
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,