mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 22:55:40 +12:00
Same for NCCH archive
This commit is contained in:
parent
d31e79ebc8
commit
0f2fa4e738
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ std::optional<u32> NCCHArchive::readFile(FileSession* file, u64 offset, u32 size
|
||||||
case PathType::RomFS: {
|
case PathType::RomFS: {
|
||||||
const u64 romFSSize = cxi->romFS.size;
|
const u64 romFSSize = cxi->romFS.size;
|
||||||
const u64 romFSOffset = cxi->romFS.offset;
|
const u64 romFSOffset = cxi->romFS.offset;
|
||||||
if ((offset >> 32) || (offset >= romFSSize) || (offset + size >= romFSSize)) {
|
if ((offset >> 32) || (offset >= romFSSize) || (offset + size > romFSSize)) {
|
||||||
Helpers::panic("Tried to read from NCCH with too big of an offset");
|
Helpers::panic("Tried to read from NCCH with too big of an offset");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,4 +166,4 @@ std::optional<u32> NCCHArchive::readFile(FileSession* file, u64 offset, u32 size
|
||||||
}
|
}
|
||||||
|
|
||||||
return u32(bytesRead);
|
return u32(bytesRead);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue