when vkcreatefoo foo  fails  the spec requires that vkcreatefoo not modify foo  as a consequence  when vkcreateimageview fails here  vk image view remains unitialized memory  and scopedvkimageview below gets initialized with garbage bits solution  check the vkcreateimageview result before creating the scopedvkimageview 