Do not allow CDs with more than one tracks, or non-mode1 tracks to be written as raw images (.iso).

This commit is contained in:
2018-11-24 13:47:51 +00:00
parent e6db4c678d
commit ae3ab2aeef

View File

@@ -401,7 +401,8 @@ namespace DiscImageChef.Core.Devices.Dumping
? TrackType.Data
: TrackType.Audio,
TrackStartSector =
(ulong)(trk.PHOUR * 3600 * 75 + trk.PMIN * 60 * 75 + trk.PSEC * 75 + trk.PFRAME - 150),
(ulong)(trk.PHOUR * 3600 * 75 + trk.PMIN * 60 * 75 + trk.PSEC * 75 +
trk.PFRAME - 150),
TrackBytesPerSector = (int)SECTOR_SIZE,
TrackRawBytesPerSector = (int)SECTOR_SIZE,
TrackSubchannelType = subType
@@ -735,6 +736,30 @@ namespace DiscImageChef.Core.Devices.Dumping
}
}
if(outputPlugin.Id == new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
{
if(tracks.Length > 1)
{
DicConsole.WriteLine("Output format does not support more than 1 track, not continuing...");
dumpLog.WriteLine("Output format does not support more than 1 track, not continuing...");
return;
}
if(tracks.Any(t => t.TrackType == TrackType.Audio))
{
DicConsole.WriteLine("Output format does not support audio tracks, not continuing...");
dumpLog.WriteLine("Output format does not support audio tracks, not continuing...");
return;
}
if(tracks.Any(t => t.TrackType != TrackType.CdMode1))
{
DicConsole.WriteLine("Output format only supports MODE 1 tracks, not continuing...");
dumpLog.WriteLine("Output format only supports MODE 1 tracks, not continuing...");
return;
}
}
// Check if something prevents from dumping the Lead-in
if(dumpLeadIn && readcd)
{
@@ -1345,9 +1370,7 @@ namespace DiscImageChef.Core.Devices.Dumping
pgMmc = new Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 32, Parameter = 0x00};
currentModePage = new Modes.ModePage
{
Page = 0x01,
Subpage = 0x00,
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
};
}
@@ -1621,8 +1644,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Modes.DecodedMode md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
Pages = new[] {currentModePage.Value}
Header = new Modes.ModeHeader(), Pages = new[] {currentModePage.Value}
};
md6 = Modes.EncodeMode6(md, dev.ScsiType);
md10 = Modes.EncodeMode10(md, dev.ScsiType);