mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Do not add drivers of size 0 neither Apple_Free partitions as
these can expand beyond the disc on optical media.
This commit is contained in:
@@ -109,6 +109,9 @@ namespace DiscImageChef.PartPlugins
|
|||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddSize = {0}", ddm.sbMap[i].ddSize, i);
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddSize = {0}", ddm.sbMap[i].ddSize, i);
|
||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddType = {0}", ddm.sbMap[i].ddType, i);
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddType = {0}", ddm.sbMap[i].ddType, i);
|
||||||
|
|
||||||
|
if(ddm.sbMap[i].ddSize == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
CommonTypes.Partition part = new CommonTypes.Partition()
|
CommonTypes.Partition part = new CommonTypes.Partition()
|
||||||
{
|
{
|
||||||
Size = (ulong)(ddm.sbMap[i].ddSize * 512),
|
Size = (ulong)(ddm.sbMap[i].ddSize * 512),
|
||||||
@@ -119,6 +122,9 @@ namespace DiscImageChef.PartPlugins
|
|||||||
Type = "Apple_Driver"
|
Type = "Apple_Driver"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if((ddm.sbMap[i].ddSize * 512) % sector_size > 0)
|
||||||
|
part.Length++;
|
||||||
|
|
||||||
partitions.Add(part);
|
partitions.Add(part);
|
||||||
|
|
||||||
sequence++;
|
sequence++;
|
||||||
@@ -261,7 +267,9 @@ namespace DiscImageChef.PartPlugins
|
|||||||
|
|
||||||
// BeOS doesn't mark its partitions as valid
|
// BeOS doesn't mark its partitions as valid
|
||||||
//if(flags.HasFlag(AppleMapFlags.Valid) &&
|
//if(flags.HasFlag(AppleMapFlags.Valid) &&
|
||||||
if(StringHandlers.CToString(entry.type) != "Apple_partition_map" && entry.sectors > 0)
|
if(StringHandlers.CToString(entry.type) != "Apple_partition_map" && entry.sectors > 0 &&
|
||||||
|
// Some CD and DVDs end with an Apple_Free that expands beyond the disc size...
|
||||||
|
StringHandlers.CToString(entry.type) != "Apple_Free")
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user