mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 08:14:45 +02:00
Improve logging about corrupt ISOs
This commit is contained in:
@@ -177,6 +177,14 @@ ISOFileSystem::~ISOFileSystem() {
|
||||
delete treeroot;
|
||||
}
|
||||
|
||||
std::string ISOFileSystem::TreeEntry::BuildPath() {
|
||||
if (parent) {
|
||||
return parent->BuildPath() + "/" + name;
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
||||
for (u32 secnum = root->startsector, endsector = root->startsector + (root->dirsize + 2047) / 2048; secnum < endsector; ++secnum) {
|
||||
u8 theSector[2048];
|
||||
@@ -228,12 +236,12 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
||||
entry->startsector = dir.firstDataSector;
|
||||
entry->dirsize = dir.dataLength;
|
||||
entry->valid = isFile; // Can pre-mark as valid if file, as we don't recurse into those.
|
||||
VERBOSE_LOG(FILESYS, "%s: %s %08x %08x %i", entry->isDirectory ? "D" : "F", entry->name.c_str(), (u32)dir.firstDataSector, entry->startingPosition, entry->startingPosition);
|
||||
VERBOSE_LOG(FILESYS, "%s: %s %08x %08x %d", entry->isDirectory ? "D" : "F", entry->name.c_str(), (u32)dir.firstDataSector, entry->startingPosition, entry->startingPosition);
|
||||
|
||||
// Round down to avoid any false reports.
|
||||
if (isFile && dir.firstDataSector + (dir.dataLength / 2048) > blockDevice->GetNumBlocks()) {
|
||||
blockDevice->NotifyReadError();
|
||||
ERROR_LOG(FILESYS, "File '%s' starts or ends outside ISO", entry->name.c_str());
|
||||
ERROR_LOG(FILESYS, "File '%s' starts or ends outside ISO. firstDataSector: %d len: %d", entry->BuildPath().c_str(), dir.firstDataSector, dir.dataLength);
|
||||
}
|
||||
|
||||
if (entry->isDirectory && !relative) {
|
||||
|
||||
Reference in New Issue
Block a user