Mesa (master): radv: add an assertion in radv_gfx10_compute_bin_size()
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Oct 23 06:56:03 UTC 2019
Module: Mesa
Branch: master
Commit: 411ad8e7c5973f58cdc94d5ce45df21c7b994f52
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=411ad8e7c5973f58cdc94d5ce45df21c7b994f52
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Mon Oct 21 10:40:23 2019 +0200
radv: add an assertion in radv_gfx10_compute_bin_size()
To prevent out of bounds access.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
src/amd/vulkan/radv_pipeline.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index f8dd6178733..9c83e22fda2 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3226,6 +3226,7 @@ radv_gfx10_compute_bin_size(struct radv_pipeline *pipeline, const VkGraphicsPipe
color_bytes_per_pixel += vk_format_get_blocksize(format);
if (total_samples > 1) {
+ assert(samples_log <= 3);
const unsigned fmask_array[] = {0, 1, 1, 4};
fmask_bytes_per_pixel += fmask_array[samples_log];
}
More information about the mesa-commit
mailing list