From abb4e4e8297965444d2b143a7f904e850605c606 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Sun, 20 Oct 2019 10:43:51 +0200 Subject: [PATCH] Fixed potential NULL-pointer access when creating a new image `is_vk_call_successful` returns true even if the result of `vkCreateImage` is `VK_ERROR_VALIDATION_FAILED_EXT`. The specification doesn't mention it as a valid return code, but in some cases it can be returned by the Nvidia drivers anyway, in which case `m_image` will be NULL. --- src/wrappers/image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrappers/image.cpp b/src/wrappers/image.cpp index 16a0345e..c24ba8c4 100644 --- a/src/wrappers/image.cpp +++ b/src/wrappers/image.cpp @@ -620,7 +620,7 @@ bool Anvil::Image::init() &m_image); } - if (!is_vk_call_successful(result) ) + if (!is_vk_call_successful(result) || !m_image) { anvil_assert_vk_call_succeeded(result);