Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added a check for out of bounds memory accesses. Fixes Avatar: The La…
…st Airbender (GC).
  • Loading branch information
skidau committed Aug 17, 2012
1 parent 08a9c66 commit 28bc5ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Core/Core/Src/HW/Memmap.cpp
Expand Up @@ -635,7 +635,8 @@ u8 *GetPointer(const u32 _Address)
{
case 0x0:
case 0x8:
return m_pPhysicalRAM + (_Address & RAM_MASK);
if ((_Address & 0xfffffff) < REALRAM_SIZE)
return m_pPhysicalRAM + (_Address & RAM_MASK);
case 0xc:
switch (_Address >> 24)
{
Expand All @@ -647,14 +648,16 @@ u8 *GetPointer(const u32 _Address)
break;

default:
return m_pPhysicalRAM + (_Address & RAM_MASK);
if ((_Address & 0xfffffff) < REALRAM_SIZE)
return m_pPhysicalRAM + (_Address & RAM_MASK);
}

case 0x1:
case 0x9:
case 0xd:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
return m_pPhysicalEXRAM + (_Address & EXRAM_MASK);
if ((_Address & 0xfffffff) < EXRAM_SIZE)
return m_pPhysicalEXRAM + (_Address & EXRAM_MASK);
else
break;

Expand Down

0 comments on commit 28bc5ec

Please sign in to comment.