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
@ -590,13 +590,16 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
|
|||||||
|
|
||||||
if (tmem_cfg.preload_tile_info.type != 3)
|
if (tmem_cfg.preload_tile_info.type != 3)
|
||||||
{
|
{
|
||||||
bytes_read = tmem_cfg.preload_tile_info.count * TMEM_LINE_SIZE;
|
if (tmem_addr_even < TMEM_SIZE)
|
||||||
if (tmem_addr_even + bytes_read > TMEM_SIZE)
|
{
|
||||||
bytes_read = TMEM_SIZE - tmem_addr_even;
|
bytes_read = tmem_cfg.preload_tile_info.count * TMEM_LINE_SIZE;
|
||||||
|
if (tmem_addr_even + bytes_read > TMEM_SIZE)
|
||||||
|
bytes_read = TMEM_SIZE - tmem_addr_even;
|
||||||
|
|
||||||
auto& system = Core::System::GetInstance();
|
auto& system = Core::System::GetInstance();
|
||||||
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!)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user