From 4a4078d276681078f8d42ea0db74d48541416ce1 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Mon, 17 Feb 2020 13:22:49 -0700 Subject: [PATCH] Fixed lack of nullptr check for app and engine name in InstanceBuilder --- src/VkBootstrap.cpp | 4 ++-- src/VkBootstrap.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index a92b8b2..d1471cb 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -172,9 +172,9 @@ detail::Expected> InstanceBuilder::build VkApplicationInfo app_info = {}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pNext = nullptr; - app_info.pApplicationName = info.app_name; + app_info.pApplicationName = info.app_name != nullptr ? info.app_name : ""; app_info.applicationVersion = info.application_version; - app_info.pEngineName = info.engine_name; + app_info.pEngineName = info.engine_name != nullptr ? info.engine_name : ""; app_info.engineVersion = info.engine_version; app_info.apiVersion = info.api_version; diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index 4acda4b..a3e82e8 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -158,8 +158,8 @@ class InstanceBuilder { private: struct InstanceInfo { // VkApplicationInfo - const char* app_name; - const char* engine_name; + const char* app_name = nullptr; + const char* engine_name = nullptr; uint32_t application_version = 0; uint32_t engine_version = 0; uint32_t api_version = VK_MAKE_VERSION (1, 0, 0);