mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
Check whether WAD is a channel before reading names
Dolphin assumes that content 0 is opening.bnr, without checking whether content 0 exists or if it is even supposed to be there (it's only there for channels). This results in sometimes reading garbage. This adds a check to only try to read names from content 0's header if the title is a channel (channel, system channel or game channel).
This commit is contained in:
@ -130,6 +130,9 @@ Platform CVolumeWAD::GetVolumeType() const
|
||||
|
||||
std::map<Language, std::string> CVolumeWAD::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()))
|
||||
return std::map<Language, std::string>();
|
||||
|
Reference in New Issue
Block a user