CDAudio: don't crash when read requested past end of disc
This commit is contained in:
parent
d7c267cbbe
commit
e61ea6050a
|
@ -124,7 +124,10 @@ namespace BizHawk.Emulation.Sound
|
||||||
{
|
{
|
||||||
if (CachedSector != CurrentSector)
|
if (CachedSector != CurrentSector)
|
||||||
{
|
{
|
||||||
Disc.ReadLBA_2352(CurrentSector, SectorCache, 0);
|
if (CurrentSector >= Disc.LBACount)
|
||||||
|
Array.Clear(SectorCache, 0, 2352); // request reading past end of available disc
|
||||||
|
else
|
||||||
|
Disc.ReadLBA_2352(CurrentSector, SectorCache, 0);
|
||||||
CachedSector = CurrentSector;
|
CachedSector = CurrentSector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue