mirror of https://github.com/PCSX2/pcsx2.git
Stop the crash in cdvd detection when system.cnf is too big. Probably not the best way to implement it but it should work.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2232 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
27c493ec9d
commit
7aae31db39
|
@ -31,6 +31,7 @@
|
|||
#include "IsoFS/IsoFS.h"
|
||||
#include "IsoFS/IsoFSCDVD.h"
|
||||
#include "CDVDisoReader.h"
|
||||
#include "Utilities/ScopedPtr.h"
|
||||
|
||||
const wxChar* CDVD_SourceLabels[] =
|
||||
{
|
||||
|
@ -77,14 +78,14 @@ static int CheckDiskTypeFS(int baseType)
|
|||
|
||||
int size = file.getLength();
|
||||
|
||||
char buffer[256]; //if the file is longer...it should be shorter :D
|
||||
file.read((u8*)buffer,size);
|
||||
ScopedArray<char> buffer((int)file.getLength()+1);
|
||||
file.read((u8*)(buffer.GetPtr()),size);
|
||||
buffer[size]='\0';
|
||||
|
||||
char* pos = strstr(buffer, "BOOT2");
|
||||
char* pos = strstr(buffer.GetPtr(), "BOOT2");
|
||||
if (pos == NULL)
|
||||
{
|
||||
pos = strstr(buffer, "BOOT");
|
||||
pos = strstr(buffer.GetPtr(), "BOOT");
|
||||
if (pos == NULL) return CDVD_TYPE_ILLEGAL;
|
||||
return CDVD_TYPE_PSCD;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue