Workaround for a weird I/O issue

This commit is contained in:
Henrik Rydgard
2013-11-23 12:49:32 +01:00
parent e0eb152fb9
commit ab6bdfa84d
+6 -2
View File
@@ -382,11 +382,15 @@ u32 ISOFileSystem::OpenFile(std::string filename, FileAccess access, const char
{
u32 sectorStart = 0xFFFFFFFF, readSize = 0xFFFFFFFF;
parseLBN(filename, &sectorStart, &readSize);
if (sectorStart >= blockDevice->GetNumBlocks())
if (sectorStart > blockDevice->GetNumBlocks())
{
WARN_LOG(FILESYS, "Unable to open raw sector: %s, sector %08x, max %08x", filename.c_str(), sectorStart, blockDevice->GetNumBlocks());
WARN_LOG(FILESYS, "Unable to open raw sector, out of range: %s, sector %08x, max %08x", filename.c_str(), sectorStart, blockDevice->GetNumBlocks());
return 0;
}
else if (sectorStart == blockDevice->GetNumBlocks())
{
ERROR_LOG(FILESYS, "Should not be able to open the block after the last on disc! %08x", sectorStart);
}
DEBUG_LOG(FILESYS, "Got a raw sector open: %s, sector %08x, size %08x", filename.c_str(), sectorStart, readSize);
u32 newHandle = hAlloc->GetNewHandle();