From: Marcin Ślusarz Date: Thu, 30 Jul 2020 12:40:21 +0000 (+0200) Subject: iris: verify color component width in convert_fast_clear_color X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e676ac67171b93b0bd6be5d5b801087f305b2d5;p=mesa.git iris: verify color component width in convert_fast_clear_color Coverity complains about possible 2^32-1 bit shift. Signed-off-by: Marcin Ślusarz Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index cf0699726fd..4171a876c76 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -163,6 +163,7 @@ convert_fast_clear_color(struct iris_context *ice, for (int i = 0; i < 4; i++) { unsigned bits = util_format_get_component_bits( format, UTIL_FORMAT_COLORSPACE_RGB, i); + assert(bits > 0); if (bits < 32) { int32_t max = (1 << (bits - 1)) - 1; int32_t min = -(1 << (bits - 1));