diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-07 23:20:54 -0400 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-07 23:20:54 -0400 |
| commit | a81d1c250a74e438c9e19ee9d9ecff263d33adfe (patch) | |
| tree | b4d32e48202e3ed85a83711958542bc57258ee31 /Source/Core/DiscIO/VolumeGC.cpp | |
| parent | 51b440fbcfe8a8f9314c2c465ff2285dc197e81a (diff) | |
| parent | 78b6ed0218da61bf75f3179850d780ed8f02f3bf (diff) | |
Merge pull request #2512 from JosJuice/bnr-size-match
VolumeGC: Check that opening.bnr size matches type
Diffstat (limited to 'Source/Core/DiscIO/VolumeGC.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeGC.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index 8a396cff00..07682e7a65 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -296,24 +296,24 @@ bool CVolumeGC::LoadBannerFile() const file_system->ReadFile("opening.bnr", m_banner_file.data(), m_banner_file.size()); u32 bannerSignature = *(u32*)m_banner_file.data(); - switch (bannerSignature) + if (file_size == BNR1_SIZE && bannerSignature == 0x31524e42) // "BNR1" { - case 0x31524e42: // "BNR1" m_banner_file_type = BANNER_BNR1; - break; - case 0x32524e42: // "BNR2" + } + else if (file_size == BNR2_SIZE && bannerSignature == 0x32524e42) // "BNR2" + { m_banner_file_type = BANNER_BNR2; - break; - default: + } + else + { m_banner_file_type = BANNER_INVALID; - WARN_LOG(DISCIO, "Invalid opening.bnr type"); - break; + WARN_LOG(DISCIO, "Invalid opening.bnr. Type: %0x Size: %0lx", bannerSignature, (unsigned long)file_size); } } else { m_banner_file_type = BANNER_INVALID; - WARN_LOG(DISCIO, "Invalid opening.bnr size: %0lx", (unsigned long)file_size); + WARN_LOG(DISCIO, "Invalid opening.bnr. Size: %0lx", (unsigned long)file_size); } return m_banner_file_type != BANNER_INVALID; |
