mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Report any attempt to read a negative size.
If this should return an error, that should be handled in sceIo.
This commit is contained in:
1 parent
01ff8709da
commit
52288f5905
3 files changed
+20
-6
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "Core/FileSystems/VirtualDiscFileSystem.h"
|
||||
#include "Core/FileSystems/ISOFileSystem.h"
|
||||
#include "Core/HLE/sceKernel.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "file/zip_read.h"
|
||||
#include "util/text/utf8.h"
|
||||
|
||||
@@ -434,8 +435,12 @@ size_t VirtualDiscFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) {
|
||||
|
||||
size_t VirtualDiscFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size, int &usec) {
|
||||
EntryMap::iterator iter = entries.find(handle);
|
||||
if (iter != entries.end())
|
||||
{
|
||||
if (iter != entries.end()) {
|
||||
if (size < 0) {
|
||||
ERROR_LOG_REPORT(FILESYS, "Invalid read for %lld bytes from virtual umd", size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// it's the whole iso... it could reference any of the files on the disc.
|
||||
// For now let's just open and close the files on demand. Can certainly be done
|
||||
// better though
|
||||
|
||||
Reference in new issue
Block a user