Fix reading of Alcohol 120% images with a hidden track.

This commit is contained in:
2021-07-06 18:00:23 +01:00
parent e702578562
commit 450bb79aeb

View File

@@ -230,6 +230,15 @@ namespace Aaru.DiscImages
if(track.subMode == SubchannelMode.Interleaved)
track.sectorSize -= 96;
if(track.point == 1 &&
track.startLba > 0)
{
AaruConsole.
ErrorWriteLine("The disc this image represents contained a hidden track in the first pregap, that this image format cannot store. This dump is therefore, incorrect.");
track.startLba = 0;
}
if(!sesToc.ContainsKey(track.point))
sesToc.Add(track.point, track);
@@ -262,6 +271,9 @@ namespace Aaru.DiscImages
AaruConsole.DebugWriteLine("Alcohol 120% plugin", "track[{1}].extra.sectors = {0}", extra.sectors,
track.point);
if(track.point == 1)
extra.sectors += extra.pregap - 150;
_alcTrackExtras.Add(track.point, extra);
}
else if(_isDvd)
@@ -871,6 +883,15 @@ namespace Aaru.DiscImages
byte[] buffer = new byte[sectorSize * length];
if(alcTrack.point == 1 &&
alcExtra.pregap > 150)
{
if(sectorAddress + 150 < alcExtra.pregap)
return buffer;
sectorAddress -= alcExtra.pregap - 150;
}
_imageStream = _alcImage.GetDataForkStream();
var br = new BinaryReader(_imageStream);
@@ -1275,6 +1296,15 @@ namespace Aaru.DiscImages
byte[] buffer = new byte[sectorSize * length];
if(alcTrack.point == 1 &&
alcExtra.pregap > 150)
{
if(sectorAddress + 150 < alcExtra.pregap)
return buffer;
sectorAddress -= alcExtra.pregap - 150;
}
_imageStream = _alcImage.GetDataForkStream();
var br = new BinaryReader(_imageStream);
@@ -1358,6 +1388,15 @@ namespace Aaru.DiscImages
byte[] buffer = new byte[sectorSize * length];
if(alcTrack.point == 1 &&
alcExtra.pregap > 150)
{
if(sectorAddress + 150 < alcExtra.pregap)
return buffer;
sectorAddress -= alcExtra.pregap - 150;
}
_imageStream = _alcImage.GetDataForkStream();
var br = new BinaryReader(_imageStream);