From 138b0cb14ed1761d4285a6546e6d53050f4e6a45 Mon Sep 17 00:00:00 2001 From: Dwayne Slater Date: Mon, 13 Mar 2017 14:49:31 -0400 Subject: [PATCH] VolumeDirectory: Align the name table size up properly If the name table isn't rounded up, a Wii game can read an incorrect number of bytes when fetching the FST. --- Source/Core/DiscIO/VolumeDirectory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index ea9462c423..c10a900777 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -350,7 +350,7 @@ void CVolumeDirectory::BuildFST() m_fst_data.clear(); File::FSTEntry rootEntry = File::ScanDirectoryTree(m_root_directory, true); - u32 name_table_size = ComputeNameSize(rootEntry); + u32 name_table_size = Common::AlignUp(ComputeNameSize(rootEntry), 1ull << m_address_shift); u64 total_entries = rootEntry.size + 1; // The root entry itself isn't counted in rootEntry.size m_fst_name_offset = total_entries * ENTRY_SIZE; // offset of name table in FST