Public bug reported:
1) Ubuntu 22.04.3 LTS
2) libfreeimage3 3.18.0+ds2-6ubuntu5.1
3) Should open BMP files with all supported dib headersizes
4) When using BMP files with DIB Header sizes != sizeof(BITMAPINFOHEADER)
loading results in "invalid Format"
Since 3.18.0+ds2-6ubuntu5.1 "CheckBitmapInfoHeader" was introduced into
PuginBMP.
The CheckBitmapInfoHeader performs (shortened)
if (bih->biSize != sizeof(BITMAPINFOHEADER)) {
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:
CheckBitmapInfoHeader(BITMAPINFOHEADER *bih) {
if (bih->biSize != sizeof(BITMAPINFOHEADER)) {
switch(bih->biSize) {
case 40: // sizeof(BITMAPINFOHEADER)
case 52: // sizeof(BITMAPV2INFOHEADER)
case 56: // sizeof(BITMAPV3INFOHEADER)
case 108: // sizeof(BITMAPV4HEADER)
case 124: // sizeof(BITMAPV5HEADER)
return TRUE;
default:
return FALSE;
}
}
** Affects: freeimage (Ubuntu)
Importance: Undecided
Status: New
** Attachment added: "Sample bmp with 108bytes DIB Header"
https://bugs.launchpad.net/bugs/2056569/+attachment/5754066/+files/no-alpha_640x360_RGB24.bmp
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2056569
Title:
BMP with DIB HeaderSize != 40 could not be used anymore
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/freeimage/+bug/2056569/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs