summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-09-19 10:07:09 +0200
committerTillmann Karras <tilkax@gmail.com>2015-10-12 02:31:51 +0200
commita92b4bda95fc7915bf61e94b310d8d90dfdaf632 (patch)
tree00e5d0a89599835bc29febf8adda8fe7c8161560
parent3a2efc9f4f914d5372fe80aa940a6555b4adf545 (diff)
DiscIO: fix reading the last sector in WBFS
Instead of rounding down, round up.
-rw-r--r--Source/Core/DiscIO/WbfsBlob.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/WbfsBlob.cpp b/Source/Core/DiscIO/WbfsBlob.cpp
index 72078e5bb0..33c4c90b53 100644
--- a/Source/Core/DiscIO/WbfsBlob.cpp
+++ b/Source/Core/DiscIO/WbfsBlob.cpp
@@ -99,7 +99,7 @@ bool WbfsFileReader::ReadHeader()
if (m_wbfs_sector_size < WII_SECTOR_SIZE)
return false;
- m_blocks_per_disc = (WII_SECTOR_COUNT * WII_SECTOR_SIZE) / m_wbfs_sector_size;
+ m_blocks_per_disc = (WII_SECTOR_COUNT * WII_SECTOR_SIZE + m_wbfs_sector_size - 1) / m_wbfs_sector_size;
m_disc_info_size = align(WII_DISC_HEADER_SIZE + m_blocks_per_disc * sizeof(u16), m_hd_sector_size);
return m_header.disc_table[0] != 0;