After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700952 - invalid offset used when decoding certain BMP images
invalid offset used when decoding certain BMP images
Status: RESOLVED OBSOLETE
Product: gdk-pixbuf
Classification: Platform
Component: loaders
git master
Other Linux
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-24 11:31 UTC by Andreas Oberritter
Modified: 2018-05-22 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Add test for bug 700952 (13.89 KB, patch)
2016-12-30 12:24 UTC, Bastien Nocera
none Details | Review
tests: Add another test for bug 700952 (11.14 KB, patch)
2016-12-30 12:24 UTC, Bastien Nocera
none Details | Review

Description Andreas Oberritter 2013-05-24 11:31:00 UTC
There's a testsuite for BMP images available under the following URL:
http://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html

Gdk-pixbuf fails to decode the following picture classified as "good" correctly:
http://entropymine.com/jason/bmpsuite/bmpsuite/g/rgb16-565pal.bmp

Of those pictures classified as "questionable", decoding the following fails:
http://entropymine.com/jason/bmpsuite/bmpsuite/q/pal8offs.bmp

My guess is that the "bfOffBits" field at offset 10 of the "BITMAPFILEHEADER" gets ignored. You could validate its value based on the total file size.

Regards,
Andreas
Comment 1 Bastien Nocera 2014-10-22 17:27:41 UTC
(In reply to comment #0)
> Gdk-pixbuf fails to decode the following picture classified as "good"
> correctly:
> http://entropymine.com/jason/bmpsuite/bmpsuite/g/rgb16-565pal.bmp

With gdk-pixbuf 2.31 it shows the bottom as gnawed slightly.

> Of those pictures classified as "questionable", decoding the following fails:
> http://entropymine.com/jason/bmpsuite/bmpsuite/q/pal8offs.bmp

That one completely fails.
Comment 2 Bastien Nocera 2016-12-30 12:24:44 UTC
Created attachment 342621 [details] [review]
tests: Add test for bug 700952
Comment 3 Bastien Nocera 2016-12-30 12:24:51 UTC
Created attachment 342622 [details] [review]
tests: Add another test for bug 700952

This time for a file that completely fails to load, rather than display
incorrectly.
Comment 4 Bastien Nocera 2016-12-30 12:27:01 UTC
I don't understand the state machine in BMP loader, but the problem is that BufferPadding is not handled in the "State->Compressed == BI_BITFIELDS" case in DecodeHeader().
Comment 5 GNOME Infrastructure Team 2018-05-22 13:14:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/37.