mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
intel/isl: fix assert when surf->size_B is > UINT_MAX
I have some local tests for Sparse Resources that I wrote when I was working on that for Anv. One of them tries to create a sparse buffer with size 4294967296 (which doesn't fit in an uint32_t). Without this patch, the right side of the assertion overflows and we get: sparse: ../../src/intel/isl/isl.c:3787: isl_surf_from_mem: Assertion `surf->size_B == surf->row_pitch_B * extent.h * extent.a' failed Fixes:fcdae4d4c0("intel: Add and use isl_surf_from_mem()") Reviewed-by: Dylan Baker <dylan.c.baker@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41253> (cherry picked from commitc4b6df29bf)
This commit is contained in:
parent
dd69fd1b4d
commit
97a58f11c2
2 changed files with 2 additions and 2 deletions
|
|
@ -2284,7 +2284,7 @@
|
|||
"description": "intel/isl: fix assert when surf->size_B is > UINT_MAX",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "fcdae4d4c09cfe3f8f38011a6e2b533cbb5e04f7",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -3784,7 +3784,7 @@ isl_surf_from_mem(const struct isl_device *isl_dev,
|
|||
assert(ok);
|
||||
if (extent.a > 1)
|
||||
assert(surf->array_pitch_el_rows == extent.h);
|
||||
assert(surf->size_B == surf->row_pitch_B * extent.h * extent.a);
|
||||
assert(surf->size_B == (uint64_t)surf->row_pitch_B * extent.h * extent.a);
|
||||
assert(surf->size_B <= max_tiles * tile_size_B);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue