From c4b6df29bf50aba7046ca42d569729f2cf8de1d7 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 28 Apr 2026 16:59:15 -0700 Subject: [PATCH] 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: fcdae4d4c09c ("intel: Add and use isl_surf_from_mem()") Reviewed-by: Dylan Baker Signed-off-by: Paulo Zanoni Part-of: --- src/intel/isl/isl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 5986497b0f6..96742c86e3f 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -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); }