mirror of https://github.com/PCSX2/pcsx2.git
CDVD: Fix possible uncaught exception in CheckDiskTypeFS
This commit is contained in:
parent
e0caacfa6f
commit
97b94acd86
|
@ -77,14 +77,16 @@ static void CheckNullCDVD()
|
|||
static int CheckDiskTypeFS(int baseType)
|
||||
{
|
||||
IsoFSCDVD isofs;
|
||||
try
|
||||
{
|
||||
IsoDirectory rootdir(isofs);
|
||||
|
||||
try
|
||||
{
|
||||
IsoFile file(rootdir, L"SYSTEM.CNF;1");
|
||||
|
||||
int size = file.getLength();
|
||||
|
||||
std::unique_ptr<char[]> buffer(new char[file.getLength() + 1]);
|
||||
const int size = file.getLength();
|
||||
const std::unique_ptr<char[]> buffer = std::make_unique<char[]>(size + 1);
|
||||
file.read(buffer.get(), size);
|
||||
buffer[size] = '\0';
|
||||
|
||||
|
@ -120,6 +122,10 @@ static int CheckDiskTypeFS(int baseType)
|
|||
catch (Exception::FileNotFound&)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (Exception::FileNotFound&)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
return CDVD_TYPE_PS2DVD; // need this hack for some homebrew (SMS)
|
||||
|
|
Loading…
Reference in New Issue