mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
VideoCommon/BPStructs: Add a missing bounds check
Happened to find this when working on the previous commit.
This commit is contained in:
parent
3cfa233b63
commit
c204b33314
@ -589,6 +589,8 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
|
|||||||
u32 tmem_addr_even = tmem_cfg.preload_tmem_even * TMEM_LINE_SIZE;
|
u32 tmem_addr_even = tmem_cfg.preload_tmem_even * TMEM_LINE_SIZE;
|
||||||
|
|
||||||
if (tmem_cfg.preload_tile_info.type != 3)
|
if (tmem_cfg.preload_tile_info.type != 3)
|
||||||
|
{
|
||||||
|
if (tmem_addr_even < TMEM_SIZE)
|
||||||
{
|
{
|
||||||
bytes_read = tmem_cfg.preload_tile_info.count * TMEM_LINE_SIZE;
|
bytes_read = tmem_cfg.preload_tile_info.count * TMEM_LINE_SIZE;
|
||||||
if (tmem_addr_even + bytes_read > TMEM_SIZE)
|
if (tmem_addr_even + bytes_read > TMEM_SIZE)
|
||||||
@ -598,6 +600,7 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
|
|||||||
auto& memory = system.GetMemory();
|
auto& memory = system.GetMemory();
|
||||||
memory.CopyFromEmu(s_tex_mem.data() + tmem_addr_even, src_addr, bytes_read);
|
memory.CopyFromEmu(s_tex_mem.data() + tmem_addr_even, src_addr, bytes_read);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else // RGBA8 tiles (and CI14, but that might just be stupid libogc!)
|
else // RGBA8 tiles (and CI14, but that might just be stupid libogc!)
|
||||||
{
|
{
|
||||||
auto& system = Core::System::GetInstance();
|
auto& system = Core::System::GetInstance();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user