bug-135: param_checker incorrectly checking optional strings
authorCourtney Goeltzenleuchter <courtneygo@google.com>
Wed, 10 Feb 2016 22:13:55 +0000 (15:13 -0700)
committerIan Elliott <ianelliott@google.com>
Thu, 11 Feb 2016 16:41:59 +0000 (09:41 -0700)
https://gitlab.khronos.org/vulkan/LoaderAndTools/issues/135

layers/param_checker.cpp

index 3cbfd23..596e609 100644 (file)
@@ -1829,11 +1829,15 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
     // support is in place until now, if we survive we can report the issue now.
     layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map);
     if (pCreateInfo->pApplicationInfo) {
-      skipCall |= validate_string(my_device_data, "vkCreateInstance()", "VkInstanceCreateInfo->VkApplicationInfo->pApplicationName",
-                                  pCreateInfo->pApplicationInfo->pApplicationName);
+        if (pCreateInfo->pApplicationInfo->pApplicationName) {
+            skipCall |= validate_string(my_device_data, "vkCreateInstance()", "VkInstanceCreateInfo->VkApplicationInfo->pApplicationName",
+                                        pCreateInfo->pApplicationInfo->pApplicationName);
+        }
 
-      skipCall |= validate_string(my_device_data, "vkCreateInstance()", "VkInstanceCreateInfo->VkApplicationInfo->pEngineName",
-                                  pCreateInfo->pApplicationInfo->pEngineName);
+        if (pCreateInfo->pApplicationInfo->pEngineName) {
+          skipCall |= validate_string(my_device_data, "vkCreateInstance()", "VkInstanceCreateInfo->VkApplicationInfo->pEngineName",
+                                        pCreateInfo->pApplicationInfo->pEngineName);
+        }
     }
 
     return result;