Fix cluster numbering calculations in FAT12 and FAT16.

This commit is contained in:
2019-04-27 16:44:18 +01:00
parent 2a969452c9
commit 574e80cd6e
2 changed files with 10 additions and 6 deletions

View File

@@ -115,8 +115,9 @@ namespace DiscImageChef.Filesystems.FAT
for(int i = 0; i < clusters.Length; i++)
{
byte[] buffer = image.ReadSectors(firstClusterSector + (clusters[i] - 2) * sectorsPerCluster,
sectorsPerCluster);
byte[] buffer =
image.ReadSectors(firstClusterSector + (ulong)((clusters[i] - (fat32 ? 2 : 0)) * sectorsPerCluster),
sectorsPerCluster);
Array.Copy(buffer, 0, directoryBuffer, i * bytesPerCluster, bytesPerCluster);
}