Fix plugins crashing when sector is too small.

This commit is contained in:
2019-05-06 20:09:25 +01:00
parent 4fa7e55a65
commit ca1a226c50
7 changed files with 25 additions and 12 deletions

View File

@@ -66,6 +66,8 @@ namespace DiscImageChef.Filesystems
byte[] sbSector = imagePlugin.ReadSector(sbSectorOff + partition.Start);
byte[] sb = new byte[512];
if(sbOff + 512 > sbSector.Length) return false;
Array.Copy(sbSector, sbOff, sb, 0, 512);
ushort magic = BitConverter.ToUInt16(sb, 0x038);