| Summary: | SDL_LoadBMP: wrong handling of BMP images that have BI_BITFILEDS compression | ||
|---|---|---|---|
| Product: | SDL | Reporter: | spam |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | rpolzer |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
spam
2014-04-27 09:06:31 UTC
I was just tracking down the same problem. The issue is that the RGBA masks are actually part of struct BITMAPV4HEADER, and thus follow directly the biClrUsed value, instead of being behind the bitmap header struct. However, the commit is correct for palette images - for these, the color table indeed follows the whole header. As a solution, I suggest skipping over the whole header size AFTER reading the masks (if used). This will fix support for BMP formats v4 (since Win95) and v5 (since Win98). Can you try the latest snapshot? http://www.libsdl.org/tmp/SDL-2.0.zip Thanks! Although I didn't get to checking it yet, I believe the change https://hg.libsdl.org/SDL/rev/08f3b56969b1 must fix the issue. (In reply to Rudolf Polzer from comment #3) > Although I didn't get to checking it yet, I believe the change > https://hg.libsdl.org/SDL/rev/08f3b56969b1 must fix the issue. Yes, that changeset should fix this specific issue. --ryan. |