diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index 3b1fcfa61df..abd0d334c27 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -1775,6 +1775,11 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load(void) void TextureLoadTaskClass::Lock_Surfaces(void) { + // Guard against NULL pointer dereference + if (!D3DTexture) { + return; + } + MipLevelCount = D3DTexture->GetLevelCount(); for (unsigned int i = 0; i < MipLevelCount; ++i) @@ -2154,6 +2159,11 @@ void CubeTextureLoadTaskClass::Deinit() void CubeTextureLoadTaskClass::Lock_Surfaces(void) { + // Guard against NULL pointer dereference + if (!D3DTexture) { + return; + } + for (unsigned int f=0; f<6; f++) { for (unsigned int i=0; i