vulkaninfo: Fix uninitialized surface capabilities
authorCharles Giessen <charles@lunarg.com>
Fri, 21 Feb 2020 18:18:31 +0000 (11:18 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 21 Feb 2020 21:17:08 +0000 (14:17 -0700)
Certain surface capabilities were being used in a comparison
while unintialized if certain extensions were not supported.

Change-Id: Iaa858a43a1b8bc0a2b42897d2d36a3630a474450

vulkaninfo/vulkaninfo.h

index 8493ac1..67fa7fc 100644 (file)
@@ -892,9 +892,9 @@ class AppSurface {
     std::vector<VkSurfaceFormatKHR> surf_formats;
     std::vector<VkSurfaceFormat2KHR> surf_formats2;
 
-    VkSurfaceCapabilitiesKHR surface_capabilities;
-    VkSurfaceCapabilities2KHR surface_capabilities2_khr;
-    VkSurfaceCapabilities2EXT surface_capabilities2_ext;
+    VkSurfaceCapabilitiesKHR surface_capabilities{};
+    VkSurfaceCapabilities2KHR surface_capabilities2_khr{};
+    VkSurfaceCapabilities2EXT surface_capabilities2_ext{};
 
     AppSurface(AppInstance &inst, VkPhysicalDevice phys_device, SurfaceExtension surface_extension,
                std::vector<pNextChainBuildingBlockInfo> &sur_extension_pNextChain)