From a92b4bda95fc7915bf61e94b310d8d90dfdaf632 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sat, 19 Sep 2015 10:07:09 +0200 Subject: [PATCH] DiscIO: fix reading the last sector in WBFS Instead of rounding down, round up. --- Source/Core/DiscIO/WbfsBlob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;