summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWii.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2017-11-02 21:05:37 +0100
committerJosJuice <josjuice@gmail.com>2017-11-03 23:17:40 +0100
commit1dc2a85ccc2e3a23b9cd33d1503038223bfae320 (patch)
treed25b91be57825f521e12c18c1abf4f0606427ea5 /Source/Core/DiscIO/VolumeWii.cpp
parent6902bbb696ea7089daded57569cca637a5e69eae (diff)
Avoid UB when reading Wii volume names
Diffstat (limited to 'Source/Core/DiscIO/VolumeWii.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWii.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp
index 2158e71f1a..bc0c410c13 100644
--- a/Source/Core/DiscIO/VolumeWii.cpp
+++ b/Source/Core/DiscIO/VolumeWii.cpp
@@ -302,10 +302,10 @@ std::string VolumeWii::GetInternalName(const Partition& partition) const
std::map<Language, std::string> VolumeWii::GetLongNames() const
{
- std::vector<u8> opening_bnr(NAMES_TOTAL_BYTES);
- opening_bnr.resize(ReadFile(*this, GetGamePartition(), "opening.bnr", opening_bnr.data(),
- opening_bnr.size(), 0x5C));
- return ReadWiiNames(opening_bnr);
+ std::vector<char16_t> names(NAMES_TOTAL_CHARS);
+ names.resize(ReadFile(*this, GetGamePartition(), "opening.bnr",
+ reinterpret_cast<u8*>(names.data()), NAMES_TOTAL_BYTES, 0x5C));
+ return ReadWiiNames(names);
}
std::vector<u32> VolumeWii::GetBanner(int* width, int* height) const