Fix negative index in BlindWrite 5 and 6 disc image.

This commit is contained in:
2020-11-04 02:35:49 +00:00
parent d7db9ebac1
commit 0fc3d4e1c2

View File

@@ -809,10 +809,16 @@ namespace Aaru.DiscImages
track.TrackSequence = trk.point;
track.TrackType = BlindWriteTrackTypeToTrackType(trk.type);
if(trk.pregap > 0)
track.Indexes.Add(0, (int)(track.TrackStartSector - trk.pregap));
if(trk.pregap > 0 &&
track.TrackStartSector > 0)
{
track.Indexes[0] = (int)track.TrackStartSector - (int)trk.pregap;
track.Indexes.Add(1, (int)track.TrackStartSector);
if(track.Indexes[0] < 0)
track.Indexes[0] = 0;
}
track.Indexes[1] = (int)track.TrackStartSector;
partition.Description = track.TrackDescription;