mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Do not overflow when decoded CopyQM image is bigger than expected.
This commit is contained in:
@@ -295,9 +295,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
// In case there is omitted data
|
||||
long sectors = (header.sectorsPerTrack) * header.heads * header.totalCylinders;
|
||||
|
||||
byte[] filling = new byte[(sectors * header.sectorSize) - decodedImage.Length];
|
||||
if(filling.Length > 0)
|
||||
long fillingLen = (sectors * header.sectorSize) - decodedImage.Length;
|
||||
|
||||
if(fillingLen > 0)
|
||||
{
|
||||
byte[] filling = new byte[fillingLen];
|
||||
ArrayHelpers.ArrayFill(filling, (byte)0xF6);
|
||||
decodedImage.Write(filling, 0, filling.Length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user