Fix infinite loop when dumping multisession disc.

This commit is contained in:
2021-09-05 05:36:05 +01:00
parent abd2a56ddf
commit 5ccb874882

View File

@@ -133,6 +133,7 @@ namespace Aaru.Core.Devices.Dumping
int currentReadSpeed = _speed;
bool crossingLeadOut = false;
bool failedCrossingLeadOut = false;
bool skippingLead = false;
for(ulong i = _resume.NextBlock; (long)i <= lastSector; i += blocksToRead)
{
@@ -147,6 +148,7 @@ namespace Aaru.Core.Devices.Dumping
while(leadOutExtents.Contains(i))
{
skippingLead = true;
i++;
}
@@ -205,6 +207,16 @@ namespace Aaru.Core.Devices.Dumping
!inData)
blocksToRead += (uint)sectorsForOffset;
if(blocksToRead == 0)
{
if(!skippingLead)
i += (ulong)sectorsForOffset;
skippingLead = false;
continue;
}
if(_fixOffset && !inData)
{
// TODO: FreeBSD bug