From d1f12b19246ec62f9625118ba9caee3a3a3f936b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 7 Mar 2022 15:56:58 -0500 Subject: [PATCH] zink: assert that the dynamic state array size is big enough Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_pipeline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 6a6e153b1cf..728b387f6ad 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -244,6 +244,7 @@ zink_create_gfx_pipeline(struct zink_screen *screen, } rast_state.pNext = &rast_line_state; } + assert(state_count < ARRAY_SIZE(dynamicStateEnables)); VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {0}; pipelineDynamicStateCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;