mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 17:11:23 +00:00
SPU LLVM: Fix crashes on corrupted cache file
* Fix OOM if size is too high. * Fix out-of-bounds access beyond SPU_LS_SIZE.
This commit is contained in:
parent
deacf76ca4
commit
3f7afb8375
@ -588,9 +588,12 @@ std::deque<spu_program> spu_cache::get()
|
||||
break;
|
||||
}
|
||||
|
||||
func.resize(size);
|
||||
if (utils::add_saturate<u32>(addr, utils::mul_saturate<u32>(size, 4)) > SPU_LS_SIZE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_file.read(func.data(), func.size() * 4) != func.size() * 4)
|
||||
if (!m_file.read(func, size))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user