iris: verify color component width in convert_fast_clear_color
Coverity complains about possible 2^32-1 bit shift. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>
This commit is contained in:

committed by
Marge Bot

parent
0685815ea6
commit
5e676ac671
@@ -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));
|
||||
|
Reference in New Issue
Block a user