mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Clean up some different clamping.
Could be cleaned up more but at least this is less weird.
This commit is contained in:
@@ -554,8 +554,7 @@ size_t ISOFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size, int &usec)
|
||||
{
|
||||
positionOnIso = e.sectorStart * 2048 + e.seekPos;
|
||||
|
||||
if (e.seekPos + size > e.openSize)
|
||||
{
|
||||
if ((s64)e.seekPos + size > (s64)e.openSize) {
|
||||
size = e.openSize - e.seekPos;
|
||||
}
|
||||
}
|
||||
@@ -564,8 +563,7 @@ size_t ISOFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size, int &usec)
|
||||
_dbg_assert_msg_(FILESYS, e.file != 0, "Expecting non-raw fd to have a tree entry.");
|
||||
|
||||
//clamp read length
|
||||
if ((s64)e.seekPos > e.file->size - (s64)size)
|
||||
{
|
||||
if ((s64)e.seekPos + size > e.file->size) {
|
||||
size = e.file->size - (s64)e.seekPos;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user