summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-12 13:00:58 +0200
committerMarek Olšák <[email protected]>2016-08-17 14:15:33 +0200
commit57a8991020ae28c13b535c4d0547b46daaa1c83f (patch)
treeebec109ddb32f28052c370fd6a9d4966363b85cd
parent325379096f54dde39171d1b8804e29a8003bb3c7 (diff)
radeonsi: fix up buffer descriptor upper-bound checking
st/mesa does this too, so we're safe. Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c2
1 files changed, 1 insertions, 1 deletions
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;