[Mesa-dev] [PATCH 2/2] llvmpipe: fix undefined shift 1 << 31.

Dave Airlie airlied at gmail.com
Thu Apr 11 10:40:14 UTC 2019


From: Dave Airlie <airlied at redhat.com>

Pointed out by coverity.
---
 src/gallium/drivers/llvmpipe/lp_setup_point.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 2192789bd4c..fc1d5ef6e36 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -251,7 +251,7 @@ setup_point_coefficients( struct lp_setup_context *setup,
              * PIPE_MAX_SHADER_OUTPUTS bits.
              */
             if (semantic_index < PIPE_MAX_SHADER_OUTPUTS &&
-                (setup->sprite_coord_enable & (1 << semantic_index))) {
+                (setup->sprite_coord_enable & (1u << semantic_index))) {
                for (i = 0; i < NUM_CHANNELS; i++) {
                   if (usage_mask & (1 << i)) {
                      texcoord_coef(setup, info, slot + 1, i,
-- 
2.20.1



More information about the mesa-dev mailing list