mirror of https://github.com/PCSX2/pcsx2.git
BlockdumpFileReader: Extra error checking to detection
This commit is contained in:
parent
628560850a
commit
425b5d0478
|
@ -35,10 +35,9 @@ bool BlockdumpFileReader::DetectBlockdump(AsyncFileReader* reader)
|
||||||
|
|
||||||
reader->SetBlockSize(1);
|
reader->SetBlockSize(1);
|
||||||
|
|
||||||
char buf[5] = {0};
|
char buf[4] = {0};
|
||||||
reader->ReadSync(buf, 0, 4);
|
bool isbd = (reader->ReadSync(buf, 0, sizeof(buf)) == 4 &&
|
||||||
|
std::memcmp(buf, "BDV2", sizeof(buf)) == 0);
|
||||||
bool isbd = (strncmp(buf, "BDV2", 4) == 0);
|
|
||||||
|
|
||||||
if (!isbd)
|
if (!isbd)
|
||||||
reader->SetBlockSize(oldbs);
|
reader->SetBlockSize(oldbs);
|
||||||
|
|
Loading…
Reference in New Issue