DiscIO: Add extra IsValid checks for VolumeWAD::m_tmd
Plus an IsValid check inside TMDReader::GetContents, which is called by VolumeWAD. Fixes https://bugs.dolphin-emu.org/issues/14032.
This commit is contained in:
@@ -339,7 +339,7 @@ bool TMDReader::GetContent(u16 index, Content* content) const
|
|||||||
|
|
||||||
std::vector<Content> TMDReader::GetContents() const
|
std::vector<Content> TMDReader::GetContents() const
|
||||||
{
|
{
|
||||||
std::vector<Content> contents(GetNumContents());
|
std::vector<Content> contents(IsValid() ? GetNumContents() : 0);
|
||||||
for (size_t i = 0; i < contents.size(); ++i)
|
for (size_t i = 0; i < contents.size(); ++i)
|
||||||
GetContent(static_cast<u16>(i), &contents[i]);
|
GetContent(static_cast<u16>(i), &contents[i]);
|
||||||
return contents;
|
return contents;
|
||||||
|
|||||||
@@ -230,11 +230,17 @@ IOS::ES::TicketReader VolumeWAD::GetTicketWithFixedCommonKey() const
|
|||||||
|
|
||||||
std::string VolumeWAD::GetGameID(const Partition& partition) const
|
std::string VolumeWAD::GetGameID(const Partition& partition) const
|
||||||
{
|
{
|
||||||
|
if (!m_tmd.IsValid())
|
||||||
|
return {};
|
||||||
|
|
||||||
return m_tmd.GetGameID();
|
return m_tmd.GetGameID();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VolumeWAD::GetGameTDBID(const Partition& partition) const
|
std::string VolumeWAD::GetGameTDBID(const Partition& partition) const
|
||||||
{
|
{
|
||||||
|
if (!m_tmd.IsValid())
|
||||||
|
return {};
|
||||||
|
|
||||||
return m_tmd.GetGameTDBID();
|
return m_tmd.GetGameTDBID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user