mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix plugins crashing when sector is too small.
This commit is contained in:
@@ -181,6 +181,8 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] sbSector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSizeInSectors);
|
||||
byte[] sb = new byte[sbSizeInBytes];
|
||||
if(sbOff + sbSizeInBytes > sbSector.Length) return false;
|
||||
|
||||
Array.Copy(sbSector, sbOff, sb, 0, sbSizeInBytes);
|
||||
|
||||
ushort magic = BitConverter.ToUInt16(sb, 0x038);
|
||||
|
||||
Reference in New Issue
Block a user