From 449b871e0c0ac54728718cc8ba1f23563432e7aa Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Thu, 21 Dec 2023 10:04:35 +0100 Subject: [PATCH] vk: crash when loading custom texture Regression due to 939e2bc68f9319323f970fde7a2d2cb72de3242d Issue #1351 --- core/rend/vulkan/texture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/rend/vulkan/texture.cpp b/core/rend/vulkan/texture.cpp index 6125b584c..9768d7247 100644 --- a/core/rend/vulkan/texture.cpp +++ b/core/rend/vulkan/texture.cpp @@ -180,7 +180,8 @@ void Texture::UploadToGPU(int width, int height, const u8 *data, bool mipmapped, } } bool isNew = true; - if (width != (int)extent.width || height != (int)extent.height || format != this->format) + if (width != (int)extent.width || height != (int)extent.height + || format != this->format || !this->image) Init(width, height, format, dataSize, mipmapped, mipmapsIncluded); else isNew = false;