summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2018-11-16 17:20:26 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2018-11-20 10:56:48 +0000
commite299f1ba5964cc68a4a542422941f7648ca4e6d4 (patch)
tree9a68e6b7424cc4cc5783867d6c24495c9dcf48c5
parent2e393b483d7d0007d3e8d1771a52f41aeea0a704 (diff)
radeonsi: fix an out-of-bounds read reported by ASAN
We read 4 values out of sample_locs_8x, so make sure the array is big enough. Fixes: ac76aeef20 ("radeonsi: switch back to standard DX sample positions") Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 46a59ce0262a44d6520787741085a716c99200ed)
-rw-r--r--src/gallium/drivers/radeonsi/si_state_msaa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_msaa.c b/src/gallium/drivers/radeonsi/si_state_msaa.c
index b741bcadec8..e6d97fe6727 100644
--- a/src/gallium/drivers/radeonsi/si_state_msaa.c
+++ b/src/gallium/drivers/radeonsi/si_state_msaa.c
@@ -101,6 +101,10 @@ static const uint64_t centroid_priority_4x = 0x3210321032103210ull;
static const uint32_t sample_locs_8x[] = {
FILL_SREG(-3,-5, 5, 1, -1, 3, 7,-7),
FILL_SREG(-7,-1, 3, 7, -5, 5, 1,-3),
+ /* The following are unused by hardware, but we emit them to IBs
+ * instead of multiple SET_CONTEXT_REG packets. */
+ 0,
+ 0,
};
static const uint64_t centroid_priority_8x = 0x3546012735460127ull;