diff options
| author | Zach Hilman <zachhilman@gmail.com> | 2018-09-04 17:01:40 -0400 |
|---|---|---|
| committer | Zach Hilman <zachhilman@gmail.com> | 2018-09-04 17:01:54 -0400 |
| commit | c913136eb215699f9c8d51a8fd56490b9df7657f (patch) | |
| tree | 4564a416d8f200b69559164e2a50bdc690d49dbd /src/core/file_sys/nca_patch.cpp | |
| parent | 7d5d781b20b47aa7e5d538404bbb665759646f95 (diff) | |
bktr: Fix bucket overlap error
Diffstat (limited to 'src/core/file_sys/nca_patch.cpp')
| -rw-r--r-- | src/core/file_sys/nca_patch.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp index 1e93000d5..e0111bffc 100644 --- a/src/core/file_sys/nca_patch.cpp +++ b/src/core/file_sys/nca_patch.cpp @@ -50,7 +50,7 @@ size_t BKTR::Read(u8* data, size_t length, size_t offset) const { } if (!bktr_read) { - ASSERT_MSG(section_offset > ivfc_offset, "Offset calculation negative."); + ASSERT_MSG(section_offset >= ivfc_offset, "Offset calculation negative."); return base_romfs->Read(data, length, section_offset - ivfc_offset); } @@ -118,7 +118,7 @@ std::pair<size_t, size_t> BKTR::SearchBucketEntry(u64 offset, BlockType block, size_t bucket_id = std::count_if(block.base_offsets.begin() + 1, block.base_offsets.begin() + block.number_buckets, - [&offset](u64 base_offset) { return base_offset < offset; }); + [&offset](u64 base_offset) { return base_offset <= offset; }); const auto bucket = buckets[bucket_id]; |
