mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 18:53:58 +01:00
Return an error code for negative file sizes.
This commit is contained in:
1 parent
c085b9c082
commit
79ff697f9d
1 file changed
+7
@@ -726,6 +726,9 @@ bool __IoRead(int &result, int id, u32 data_addr, int size) {
|
||||
if (!(f->openMode & FILEACCESS_READ)) {
|
||||
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
|
||||
return true;
|
||||
} else if (size < 0) {
|
||||
result = SCE_KERNEL_ERROR_ILLEGAL_ADDR;
|
||||
return true;
|
||||
} else if (Memory::IsValidAddress(data_addr)) {
|
||||
CBreakPoints::ExecMemCheck(data_addr, true, size, currentMIPS->pc);
|
||||
u8 *data = (u8*) Memory::GetPointer(data_addr);
|
||||
@@ -857,6 +860,10 @@ bool __IoWrite(int &result, int id, u32 data_addr, int size) {
|
||||
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
|
||||
return true;
|
||||
}
|
||||
if (size < 0) {
|
||||
result = SCE_KERNEL_ERROR_ILLEGAL_ADDR;
|
||||
return true;
|
||||
}
|
||||
|
||||
CBreakPoints::ExecMemCheck(data_addr, false, size, currentMIPS->pc);
|
||||
|
||||
|
||||
Reference in new issue
Block a user