mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-19 06:45:39 +00:00
CDImage: Fix crash on invalid cue/chd with no tracks
This commit is contained in:
parent
95f7821691
commit
893268bba5
|
@ -238,6 +238,12 @@ bool CDImageCHD::Open(const char* filename)
|
|||
file_lba = Common::AlignUp(file_lba, CHD_CD_TRACK_ALIGNMENT);
|
||||
}
|
||||
|
||||
if (m_tracks.empty())
|
||||
{
|
||||
Log_ErrorPrintf("File '%s' contains no tracks", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_lba_count = disc_lba;
|
||||
AddLeadOutIndex();
|
||||
|
||||
|
|
|
@ -217,6 +217,12 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_tracks.empty())
|
||||
{
|
||||
Log_ErrorPrintf("File '%s' contains no tracks", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_lba_count = disc_lba;
|
||||
AddLeadOutIndex();
|
||||
|
||||
|
|
Loading…
Reference in a new issue