mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-07 08:39:00 +00:00
Avoid UB when reading Wii volume names
This commit is contained in:
parent
6902bbb696
commit
1dc2a85ccc
4 changed files with 15 additions and 16 deletions
|
@ -138,10 +138,10 @@ std::map<Language, std::string> VolumeWAD::GetLongNames() const
|
|||
if (!m_tmd.IsValid() || !IOS::ES::IsChannel(m_tmd.GetTitleId()))
|
||||
return {};
|
||||
|
||||
std::vector<u8> name_data(NAMES_TOTAL_BYTES);
|
||||
if (!Read(m_opening_bnr_offset + 0x9C, NAMES_TOTAL_BYTES, name_data.data()))
|
||||
std::vector<char16_t> names(NAMES_TOTAL_CHARS);
|
||||
if (!Read(m_opening_bnr_offset + 0x9C, NAMES_TOTAL_BYTES, reinterpret_cast<u8*>(names.data())))
|
||||
return std::map<Language, std::string>();
|
||||
return ReadWiiNames(name_data);
|
||||
return ReadWiiNames(names);
|
||||
}
|
||||
|
||||
std::vector<u32> VolumeWAD::GetBanner(int* width, int* height) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue