From ade4f76ac1bfa6a00921b3deb3d5fe195661236b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 1 Oct 2013 07:53:40 -0700 Subject: [PATCH] Don't try to load bogus isos, carnage awaits. --- Core/FileSystems/ISOFileSystem.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index c3a2a7af3f..d854f53cdd 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -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();