mesa/main: Fix overflow in validation of DispatchComputeGroupSizeARB
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 19 Mar 2020 00:14:19 +0000 (17:14 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Mar 2020 03:07:45 +0000 (03:07 +0000)
commitfdc603292862dd2663b75d18e9abc6096b8020ff
treea01fb635749ececad7d92294984a315d369e2842
parent4ac1d3cc45121b88708ab7bfd8f3e12389a6cdfd
mesa/main: Fix overflow in validation of DispatchComputeGroupSizeARB

An uint64_t can store the result of multiplying two GLuint (uint32_t),
so use that property to check for overflow when calculating the total.

Change the error message so we don't need to care about the actual
total -- which means we don't need a larger than 64-bit value to hold
it.

Fixes: 45ab63c0cb2 ("mesa/main: add support for ARB_compute_variable_groups_size")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4240>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4240>
src/mesa/main/compute.c