BMP with DIB HeaderSize != 40 could not be used anymore
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
freeimage (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
1) Ubuntu 22.04.3 LTS
2) libfreeimage3 3.18.0+
3) Should open BMP files with all supported dib headersizes
4) When using BMP files with DIB Header sizes != sizeof(
Since 3.18.0+
The CheckBitmapInfo
if (bih->biSize != sizeof(
return FALSE
BMP DIB Header sizes could be 40, 52, 56, 108, 124 bytes. BITMAPINFOHEADER is always size 40.
Resulting bmp files with different dib header sizes could not be loaded anymore
See the one attached.
A fix could be:
CheckBitmapInfo
if (bih->biSize != sizeof(
switch(
case 40: // sizeof(
case 52: // sizeof(
case 56: // sizeof(
case 108: // sizeof(
case 124: // sizeof(
return TRUE;
default:
return FALSE;
}
}