Don't try to load bogus isos, carnage awaits.

This commit is contained in:
Unknown W. Brackets 2013-10-01 07:53:40 -07:00
parent 90e94a6cc8
commit ade4f76ac1

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();