From 57a8991020ae28c13b535c4d0547b46daaa1c83f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 12 Aug 2016 13:00:58 +0200 Subject: [PATCH] radeonsi: fix up buffer descriptor upper-bound checking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit st/mesa does this too, so we're safe. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 7e63d487377..25dfe26787d 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2662,7 +2662,7 @@ si_make_buffer_descriptor(struct si_screen *screen, struct r600_resource *buf, data_format = si_translate_buffer_dataformat(&screen->b.b, desc, first_non_void); num_records = size / stride; - num_records = MIN2(num_records, buf->b.b.width0 / stride); + num_records = MIN2(num_records, (buf->b.b.width0 - offset) / stride); if (screen->b.chip_class >= VI) num_records *= stride; -- 2.30.2