mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Merge pull request #18896 from rofl0r/fixfscrash
FS: fix crash overreading data on flash0
This commit is contained in:
commit
d24f972468
@ -1067,6 +1067,9 @@ size_t VFSFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) {
|
||||
EntryMap::iterator iter = entries.find(handle);
|
||||
if (iter != entries.end())
|
||||
{
|
||||
if(iter->second.seekPos + size > iter->second.size)
|
||||
size = iter->second.size - iter->second.seekPos;
|
||||
if(size < 0) size = 0;
|
||||
size_t bytesRead = size;
|
||||
memcpy(pointer, iter->second.fileData + iter->second.seekPos, size);
|
||||
iter->second.seekPos += size;
|
||||
|
Loading…
Reference in New Issue
Block a user