We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2219 - BMP loader do not handle big BITMAPINFOHEADER structure
Summary: BMP loader do not handle big BITMAPINFOHEADER structure
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 20:51 UTC by Patrice Mandin
Modified: 2013-11-08 03:16 UTC (History)
0 users

See Also:


Attachments
Proposed patch (404 bytes, patch)
2013-11-07 20:51 UTC, Patrice Mandin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrice Mandin 2013-11-07 20:51:00 UTC
Created attachment 1412 [details]
Proposed patch

Hello,

I encountered a problem trying to load a 8-bit paletted BMP file using SDL. This file was generated using GIMP 2.8. It has a big BITMAPINFOHEADER (0x6c bytes for biSize field), and thus the palette is incorrectly setup.

I made this simple patch (that fixes it for my case), I do not know if processing all other stuff from the header is needed.

I think the same problem is present in SDL 2.x just having looked at the source code, I did not try.
Comment 1 Sam Lantinga 2013-11-08 03:16:31 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/44dc7926f62d