From bd66faa0a5694375f8afb5d2fd1e3f5e5bd6d097 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 12 Apr 2019 16:58:03 +1000 Subject: [PATCH] vulkaninfo: use correct type in malloc sizing. warning: Result of 'malloc' is converted to a pointer of type 'VkPresentModeKHR', which is incompatible with sizeof operand type 'VkPresentInfoKHR' Pointed out by coverity. --- vulkaninfo/vulkaninfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkaninfo/vulkaninfo.c b/vulkaninfo/vulkaninfo.c index 8dfa33b..aba5983 100644 --- a/vulkaninfo/vulkaninfo.c +++ b/vulkaninfo/vulkaninfo.c @@ -1585,7 +1585,7 @@ static int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *g err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, surface, &present_mode_count, NULL); if (err) ERR_EXIT(err); - VkPresentModeKHR *surf_present_modes = (VkPresentModeKHR *)malloc(present_mode_count * sizeof(VkPresentInfoKHR)); + VkPresentModeKHR *surf_present_modes = (VkPresentModeKHR *)malloc(present_mode_count * sizeof(VkPresentModeKHR)); if (!surf_present_modes) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY); err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, surface, &present_mode_count, surf_present_modes); if (err) ERR_EXIT(err); -- 2.7.4