mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 14:55:47 -04:00
CDImage: Fix crash on invalid cue/chd with no tracks
This commit is contained in:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user