Don't ignore Apple_Free partitions, just ignore partitions

that extend past the device size.
This commit is contained in:
2017-07-23 19:57:10 +01:00
parent 25de114914
commit f3e33aa7aa

View File

@@ -267,9 +267,7 @@ 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();
@@ -311,9 +309,17 @@ namespace DiscImageChef.PartPlugins
} }
_partition.Description = sb.ToString(); _partition.Description = sb.ToString();
// Some CD and DVDs end with an Apple_Free that expands beyond the disc size...
if(_partition.End < imagePlugin.ImageInfo.sectors)
{
partitions.Add(_partition); partitions.Add(_partition);
sequence++; sequence++;
} }
else
{
DicConsole.DebugWriteLine("AppleMap Plugin", "Not adding partition because end ({0}) is outside media size ({1})", _partition.End, imagePlugin.ImageInfo.sectors);
}
}
} }
} }