anv: fix potential integer overflow

The loop going from 0 to max_draw_count multiplies the value which
could potentially overflow.

Fixes Coverity CID 1517852

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3596a8ea7a ("anv: factor out some indirect draw count entry points")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20436>
This commit is contained in:
Lionel Landwerlin 2022-12-27 00:32:16 +02:00 committed by Marge Bot
parent eb2576902d
commit afdbed9e9c

View file

@ -4604,7 +4604,7 @@ emit_draw_count_predicate_cond(struct anv_cmd_buffer *cmd_buffer,
static void
emit_indirect_count_draws(struct anv_cmd_buffer *cmd_buffer,
struct anv_address indirect_data_addr,
uint32_t indirect_data_stride,
uint64_t indirect_data_stride,
struct anv_address draw_count_addr,
uint32_t max_draw_count,
bool indexed)