Skip to content

Commit abb4e4e

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 a13b276 commit abb4e4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)