From 411ad8e7c5973f58cdc94d5ce45df21c7b994f52 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 21 Oct 2019 10:40:23 +0200 Subject: [PATCH] radv: add an assertion in radv_gfx10_compute_bin_size() To prevent out of bounds access. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- 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]; } -- 2.30.2