Don't replace bad sectors with more bad sectors. This means that if a sector is

permanently bad, the one which wins and goes into the output SectorSet is the
first one, not the last one. Frequently the last sector is truncated by the end
of read and so it isn't useful.
This commit is contained in:
David Given
2019-08-27 22:39:24 +02:00
parent 27f5c294b1
commit 7988d0fe24

View File

@@ -149,7 +149,7 @@ static void replace_sector(std::unique_ptr<Sector>& replacing, Sector& replaceme
return;
}
}
if (!replacing || (replacing->status != Sector::OK))
if (!replacing || ((replacing->status != Sector::OK) && (replacement.status == Sector::OK)))
{
if (!replacing)
replacing.reset(new Sector);