Skip to content

Commit

Permalink
TextureCache: Fix crash for invalid textures.
Browse files Browse the repository at this point in the history
  • Loading branch information
degasus committed Nov 17, 2015
1 parent fb87de8 commit 179ddcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/VideoCommon/TextureCacheBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ TextureCacheBase::TCacheEntryBase* TextureCacheBase::Load(const u32 stage)
else
src_data = Memory::GetPointer(address);

if (!src_data)
{
ERROR_LOG(VIDEO, "Trying to use an invalid texture address 0x%8x", address);
return nullptr;
}

// TODO: This doesn't hash GB tiles for preloaded RGBA8 textures (instead, it's hashing more data from the low tmem bank than it should)
base_hash = GetHash64(src_data, texture_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
u32 palette_size = 0;
Expand Down

0 comments on commit 179ddcf

Please sign in to comment.