From 9c4b41f58e5f2a43e6637e958befae673c49d71e Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 24 Apr 2021 15:25:52 +0100 Subject: [PATCH] c/main: Assert that preferred dimensions are somewhat valid --- src/xrt/compositor/main/comp_target_swapchain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xrt/compositor/main/comp_target_swapchain.c b/src/xrt/compositor/main/comp_target_swapchain.c index f322c474e..4999b8bd3 100644 --- a/src/xrt/compositor/main/comp_target_swapchain.c +++ b/src/xrt/compositor/main/comp_target_swapchain.c @@ -214,6 +214,8 @@ comp_target_swapchain_select_extent(struct comp_target_swapchain *cts, // If width (and height) equals the special value 0xFFFFFFFF, // the size of the surface will be set by the swapchain if (caps.currentExtent.width == (uint32_t)-1) { + assert(preferred_width > 0 && preferred_height > 0); + VkExtent2D extent = { .width = preferred_width, .height = preferred_height,