Skip to content

Commit

Permalink
Fixed potential NULL-pointer access when creating a new image
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
Silverlan authored Oct 20, 2019
1 parent a13b276 commit abb4e4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wrappers/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit abb4e4e

Please sign in to comment.