Merge pull request #4046 from unknownbrackets/iso-try-anyway

Don't try to load bogus isos, carnage awaits
This commit is contained in:
Henrik Rydgård 2013-10-05 13:27:16 -07:00
commit 4ce204e331

View File

@ -192,10 +192,6 @@ ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevic
entireISO.flags = 0;
entireISO.parent = NULL;
if (memcmp(desc.cd001, "CD001", 5)) {
ERROR_LOG(FILESYS, "ISO looks bogus? trying anyway...");
}
treeroot = new TreeEntry();
treeroot->isDirectory = true;
treeroot->startingPosition = 0;
@ -203,6 +199,11 @@ ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevic
treeroot->flags = 0;
treeroot->parent = NULL;
if (memcmp(desc.cd001, "CD001", 5)) {
ERROR_LOG(FILESYS, "ISO looks bogus? Giving up...");
return;
}
u32 rootSector = desc.root.firstDataSector();
u32 rootSize = desc.root.dataLength();