mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
CDImage: Fix assert failing on invalid cuesheets
This commit is contained in:
parent
0acf6e8327
commit
abc035b15a
|
@ -125,7 +125,13 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
|
|||
std::fseek(m_files[track_file_index].file, 0, SEEK_SET);
|
||||
|
||||
file_size /= track_sector_size;
|
||||
Assert(track_start < file_size);
|
||||
if (track_start >= file_size)
|
||||
{
|
||||
Log_ErrorPrintf("Failed to open track %u in '%s': track start is out of range (%u vs %u)", track_num, filename,
|
||||
track_start, file_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
track_length = file_size - track_start;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue