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.
This commit is contained in:
Dwayne Slater 2017-03-13 14:49:31 -04:00
parent 9d633307e3
commit 138b0cb14e
1 changed files with 1 additions and 1 deletions

View File

@ -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