mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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.
This commit is contained in:
@ -193,8 +193,10 @@ void CVolumeGC::LoadBannerFile() const
|
||||
|
||||
GCBanner banner_file;
|
||||
std::unique_ptr<IFileSystem> file_system(CreateFileSystem(this, PARTITION_NONE));
|
||||
size_t file_size = static_cast<size_t>(file_system->GetFileSize("opening.bnr"));
|
||||
if (!file_system)
|
||||
return;
|
||||
|
||||
size_t file_size = static_cast<size_t>(file_system->GetFileSize("opening.bnr"));
|
||||
constexpr int BNR1_MAGIC = 0x31524e42;
|
||||
constexpr int BNR2_MAGIC = 0x32524e42;
|
||||
if (file_size != BNR1_SIZE && file_size != BNR2_SIZE)
|
||||
|
Reference in New Issue
Block a user