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:
@@ -195,8 +195,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(sbSector + partition.Start + sectorsToRead >= partition.End) return false;
|
||||
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead);
|
||||
int bootChk = 0;
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead);
|
||||
int bootChk = 0;
|
||||
if(bootSector.Length < 512) return false;
|
||||
|
||||
for(int i = 0; i < 0x1FF; i++) bootChk = (bootChk & 0xFF) + (bootChk >> 8) + bootSector[i];
|
||||
|
||||
DicConsole.DebugWriteLine("ADFS Plugin", "bootChk = {0}", bootChk);
|
||||
|
||||
Reference in New Issue
Block a user