From a028de270cd2c60b5a13c522116738fea3047082 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 16:21:32 +0000 Subject: [PATCH] bugfix(textureloader): Add null checks for D3DTexture to prevent crashes --- .../Libraries/Source/WWVegas/WW3D2/textureloader.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index f46cffff6ee..6f1a0d3adb6 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -1530,6 +1530,10 @@ bool TextureLoadTaskClass::Begin_Compressed_Load() #endif ); + if (!D3DTexture) { + return false; + } + MipLevelCount = mip_level_count; return true; @@ -1625,6 +1629,10 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load() #endif ); + if (!D3DTexture) { + return false; + } + return true; } @@ -1775,6 +1783,10 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load() void TextureLoadTaskClass::Lock_Surfaces() { + if (!D3DTexture) { + return; + } + MipLevelCount = D3DTexture->GetLevelCount(); for (unsigned int i = 0; i < MipLevelCount; ++i)