| Summary: | SDL_FillRect onto a 24-bit surface swaps Red and Blue component | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Dávid Nagy <nagydavid91> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.3 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Attachments: |
Testcase
My proposed fix. |
||
Created attachment 2156 [details]
My proposed fix.
Apply to SDL2-2.0.3/src/video/SDL_fillrect.c
Disclaimer: Although I separated the two cases of endianness, I tested it only on a little-endian system.
This patch is now https://hg.libsdl.org/SDL/rev/596a3da0c9cb, thanks! --ryan. |
Created attachment 2155 [details] Testcase When using SDL_FillRect on a 24-bit surface, the Red and Blue components of the fill color are swapped. 16-bit and 32-bit surfaces don't have this problem. The testcase should make a testcase_out.bmp filled with orange (255,192,128), but it becomes blue (128,192,255).