From: Brian Paul Date: Mon, 20 Sep 2010 21:33:49 +0000 (-0600) Subject: llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1662c317032cf280701d7e55b028b7f0dc8afc65;p=mesa.git llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTS --- 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,