diff --git a/Aaru.Images/AaruFormat/Read.cs b/Aaru.Images/AaruFormat/Read.cs index dc3d44295..dc78fe96d 100644 --- a/Aaru.Images/AaruFormat/Read.cs +++ b/Aaru.Images/AaruFormat/Read.cs @@ -77,6 +77,14 @@ public sealed partial class AaruFormat Status res = aaruf_read_sector(_context, sectorAddress, negative, buffer, ref length, out _); + // Sector not dumped + if(res == Status.SectorNotDumped && length > 0) + { + buffer = new byte[length]; + + return ErrorNumber.NoError; + } + if(res != Status.BufferTooSmall) return StatusToErrorNumber(res); buffer = new byte[length]; @@ -102,6 +110,14 @@ public sealed partial class AaruFormat Status res = aaruf_read_track_sector(_context, buffer, sectorAddress, ref length, (byte)track, out _); + // Sector not dumped + if(res == Status.SectorNotDumped && length > 0) + { + buffer = new byte[length]; + + return ErrorNumber.NoError; + } + if(res != Status.BufferTooSmall) return StatusToErrorNumber(res); buffer = new byte[length]; @@ -133,6 +149,14 @@ public sealed partial class AaruFormat Status res = aaruf_read_sector_long(_context, sectorAddress, negative, buffer, ref length, out _); + // Sector not dumped + if(res == Status.SectorNotDumped && length > 0) + { + buffer = new byte[length]; + + return ErrorNumber.NoError; + } + if(res != Status.BufferTooSmall) return StatusToErrorNumber(res); buffer = new byte[length];