Skip to content

Commit 327159d

Browse files
authored
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.
1 parent 8f4cb0e commit 327159d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wrappers/image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ bool Anvil::Image::init()
620620
&m_image);
621621
}
622622

623-
if (!is_vk_call_successful(result) )
623+
if (!is_vk_call_successful(result) || !m_image)
624624
{
625625
anvil_assert_vk_call_succeeded(result);
626626

0 commit comments

Comments
 (0)