File seek beyond file size should not fail

This caused Ridge Racer 2 to freeze after a few seconds
This commit is contained in:
Claus Østergaard 2013-01-25 13:13:32 +01:00
parent 0c4b7905ac
commit aa5996d028

View File

@ -463,7 +463,7 @@ s64 sceIoLseek(int id, s64 offset, int whence) {
seek = FILEMOVE_END;
break;
}
if(newPos < 0 || newPos > f->info.size)
if(newPos < 0)
return -1;
f->asyncResult = (u32) pspFileSystem.SeekFile(f->handle, (s32) offset, seek);
@ -497,7 +497,7 @@ u32 sceIoLseek32(int id, int offset, int whence) {
seek = FILEMOVE_END;
break;
}
if(newPos < 0 || newPos > f->info.size)
if(newPos < 0)
return -1;
f->asyncResult = (u32) pspFileSystem.SeekFile(f->handle, (s32) offset, seek);