diff options
| author | JosJuice <josjuice@gmail.com> | 2017-11-02 21:05:37 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-11-03 23:17:40 +0100 |
| commit | 1dc2a85ccc2e3a23b9cd33d1503038223bfae320 (patch) | |
| tree | d25b91be57825f521e12c18c1abf4f0606427ea5 /Source/Core/DiscIO/VolumeWad.cpp | |
| parent | 6902bbb696ea7089daded57569cca637a5e69eae (diff) | |
Avoid UB when reading Wii volume names
Diffstat (limited to 'Source/Core/DiscIO/VolumeWad.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWad.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index d09baf1f6a..2d98986f81 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -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 |
