Handle data track corner cases

This commit is contained in:
Matt Nadareski
2021-07-06 09:54:43 -07:00
parent 80a31f1fd4
commit 04b56d97a1
3 changed files with 50 additions and 7 deletions

View File

@@ -153,6 +153,13 @@ namespace RedBookPlayer.Common.Hardware
// Set the current volume
_soundOut.Volume = (float)Volume / 100;
// If we have an unreadable track, just return
if (_opticalDisc.BytesPerSector <= 0)
{
Array.Clear(buffer, offset, count);
return count;
}
// Determine how many sectors we can read
ulong sectorsToRead;
ulong zeroSectorsAmount;