mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Improve logging about corrupt ISOs
This commit is contained in:
parent
431a0551b2
commit
a920b6100c
@ -177,6 +177,14 @@ ISOFileSystem::~ISOFileSystem() {
|
|||||||
delete treeroot;
|
delete treeroot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ISOFileSystem::TreeEntry::BuildPath() {
|
||||||
|
if (parent) {
|
||||||
|
return parent->BuildPath() + "/" + name;
|
||||||
|
} else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
||||||
for (u32 secnum = root->startsector, endsector = root->startsector + (root->dirsize + 2047) / 2048; secnum < endsector; ++secnum) {
|
for (u32 secnum = root->startsector, endsector = root->startsector + (root->dirsize + 2047) / 2048; secnum < endsector; ++secnum) {
|
||||||
u8 theSector[2048];
|
u8 theSector[2048];
|
||||||
@ -228,12 +236,12 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
|||||||
entry->startsector = dir.firstDataSector;
|
entry->startsector = dir.firstDataSector;
|
||||||
entry->dirsize = dir.dataLength;
|
entry->dirsize = dir.dataLength;
|
||||||
entry->valid = isFile; // Can pre-mark as valid if file, as we don't recurse into those.
|
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.
|
// Round down to avoid any false reports.
|
||||||
if (isFile && dir.firstDataSector + (dir.dataLength / 2048) > blockDevice->GetNumBlocks()) {
|
if (isFile && dir.firstDataSector + (dir.dataLength / 2048) > blockDevice->GetNumBlocks()) {
|
||||||
blockDevice->NotifyReadError();
|
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) {
|
if (entry->isDirectory && !relative) {
|
||||||
|
@ -60,6 +60,9 @@ private:
|
|||||||
struct TreeEntry {
|
struct TreeEntry {
|
||||||
~TreeEntry();
|
~TreeEntry();
|
||||||
|
|
||||||
|
// Recursive function that reconstructs the path by looking at the parent pointers.
|
||||||
|
std::string BuildPath();
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
u32 flags = 0;
|
u32 flags = 0;
|
||||||
u32 startingPosition = 0;
|
u32 startingPosition = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user