From 9c90deefb2356c970520a404375b0e1796df1535 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 28 Mar 2023 18:31:05 +0200 Subject: [PATCH] radeonsi: don't use alignment_log2 of imported buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This value isn't passed to the importer by the kernel so we can't check it. Fixes: f7a4051b836 ("radeonsi: Check pitch and offset for validity.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8431 Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 8c5051e74f0..3abc59b6346 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1646,8 +1646,7 @@ static struct pipe_resource *si_texture_from_winsys_buffer(struct si_screen *ssc } if (ac_surface_get_plane_offset(sscreen->info.gfx_level, &tex->surface, 0, 0) + - tex->surface.total_size > buf->size || - buf->alignment_log2 < tex->surface.alignment_log2) { + tex->surface.total_size > buf->size) { si_texture_reference(&tex, NULL); return NULL; }