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

Summary: BMP loader do not handle big BITMAPINFOHEADER structure
Product: SDL Reporter: Patrice Mandin <patmandin>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: All   
OS: All   
Attachments: Proposed patch

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