From 331ae9a30fe8a711217956c6ec4873c1dfae95b9 Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 1 Aug 2022 00:59:43 +0800 Subject: [PATCH] Fix crash when GEVulkanTexture::getTextureData failed --- lib/graphics_engine/src/ge_vulkan_texture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/graphics_engine/src/ge_vulkan_texture.cpp b/lib/graphics_engine/src/ge_vulkan_texture.cpp index 4e235b00d..3b58f9b0f 100644 --- a/lib/graphics_engine/src/ge_vulkan_texture.cpp +++ b/lib/graphics_engine/src/ge_vulkan_texture.cpp @@ -438,6 +438,8 @@ void GEVulkanTexture::upload(uint8_t* data, bool generate_hq_mipmap) void* GEVulkanTexture::lock(video::E_TEXTURE_LOCK_MODE mode, u32 mipmap_level) { uint8_t* texture_data = getTextureData(); + if (!texture_data) + return NULL; if (isSingleChannel()) { m_locked_data = new uint8_t[m_size.Width * m_size.Height * 4]();