diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2016-05-29 18:33:09 +0200 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2016-05-29 18:33:09 +0200 |
| commit | ad0ef70314e243c73e2b73dacc4204a2cbb349c9 (patch) | |
| tree | 9932035446842921bac39e6f9ff2e2cdfa990b12 /Source/Core/DiscIO/Blob.cpp | |
| parent | 2a79ac0d288857e32fb9235c7778f27ea8cf8c56 (diff) | |
| parent | c4240692b6271cd3c8a93e8fa147df67df3e32fa (diff) | |
Merge pull request #3868 from delroth/sector-reader
SectorReader: Fix reading the last block of the disc.
Diffstat (limited to 'Source/Core/DiscIO/Blob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Blob.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp index 19bd9faf7d..0b726c3ffb 100644 --- a/Source/Core/DiscIO/Blob.cpp +++ b/Source/Core/DiscIO/Blob.cpp @@ -141,7 +141,7 @@ u32 SectorReader::ReadChunk(u8* buffer, u64 chunk_num) // If we are reading the end of a disk, there may not be enough blocks to // read a whole chunk. We need to clamp down in that case. - u64 end_block = GetDataSize() / m_block_size; + u64 end_block = (GetDataSize() + m_block_size - 1) / m_block_size; if (end_block) cnt_blocks = static_cast<u32>(std::min<u64>(m_chunk_blocks, end_block - block_num)); |
