Correct when OS/2 bitmap size is image size and not header size.

This commit is contained in:
2018-03-05 15:01:33 +00:00
parent 432f11ea57
commit 2c89daf694

View File

@@ -93,6 +93,7 @@ namespace libexeinfo.Os2
{
remaining = 1;
pos = 0;
bitmapArrayHeader.Next = 0;
}
while(remaining > 0)
@@ -102,13 +103,13 @@ namespace libexeinfo.Os2
bitmapFileHeader = BigEndianMarshal.ByteArrayToStructureLittleEndian<BitmapInfoHeader>(buffer);
// Stop at unknown header
if(bitmapFileHeader.Size != Marshal.SizeOf(typeof(BitmapInfoHeader))) break;
if(bitmapFileHeader.Fix != 12) break;
// Multiplanes not supported
if(bitmapFileHeader.Planes != 1) break;
// TODO: Non paletted?
pos += bitmapFileHeader.Size;
pos += Marshal.SizeOf(typeof(BitmapInfoHeader));
RGB[] palette = new RGB[1 << bitmapFileHeader.BitsPerPlane];
buffer = new byte[Marshal.SizeOf(typeof(RGB))];
for(int i = 0; i < palette.Length; i++)