mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
panfrost: Make sure pack_work_groups_compute() is passed valid dimensions
Make sure size_{x,y,z} and num_{x,y,s} are positive, otherwise we end
up with an integer underflow.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10332>
This commit is contained in:
parent
54a4e75223
commit
7d14a0cb99
1 changed files with 6 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ panfrost_pack_work_groups_compute(
|
|||
|
||||
unsigned shifts[7] = { 0 };
|
||||
|
||||
/* Make sure size_{x,y,z} and num_{x,y,z} are positive, otherwise we
|
||||
* end up with an integer underflow.
|
||||
*/
|
||||
assert(size_x && size_y && size_z);
|
||||
assert(num_x && num_y && num_z);
|
||||
|
||||
unsigned values[6] = {
|
||||
MALI_POSITIVE(size_x),
|
||||
MALI_POSITIVE(size_y),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue