summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWiiCrypted.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2015-06-03 13:19:28 +0200
committerJosJuice <josjuice@gmail.com>2017-05-16 22:59:01 +0200
commit2bcad57225b9b0a4635d62eeabbbb138d71386bf (patch)
treebd1376e2ebbbed58f1b75a73956aaf81d56812e6 /Source/Core/DiscIO/VolumeWiiCrypted.cpp
parent639ce6c484c58c577c978eb9eda08e7800e959b1 (diff)
Check file system validity before reading opening.bnr
This happened to work without any problems because the only way for a file system to be invalid was to not have the right GC/Wii magic word in the unencrypted area, and a volume could not be created without having the right GC/Wii magic word there. Now that file systems read the magic word from a partition instead, a fix is needed.
Diffstat (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
index 310d447c43..05d34aa126 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
@@ -299,6 +299,9 @@ std::string CVolumeWiiCrypted::GetInternalName(const Partition& partition) const
std::map<Language, std::string> CVolumeWiiCrypted::GetLongNames() const
{
std::unique_ptr<IFileSystem> file_system(CreateFileSystem(this, GetGamePartition()));
+ if (!file_system)
+ return {{}};
+
std::vector<u8> opening_bnr(NAMES_TOTAL_BYTES);
size_t size = file_system->ReadFile("opening.bnr", opening_bnr.data(), opening_bnr.size(), 0x5C);
opening_bnr.resize(size);