Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_FillRect onto a 24-bit surface swaps Red and Blue component #1860

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

SDL_FillRect onto a 24-bit surface swaps Red and Blue component #1860

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.3
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2015-05-17 17:09:41 +0000, Dávid Nagy wrote:

Created attachment 2155
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).

On 2015-05-17 17:25:06 +0000, Dávid Nagy wrote:

Created attachment 2156
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.

On 2015-05-31 15:38:41 +0000, Ryan C. Gordon wrote:

This patch is now https://hg.libsdl.org/SDL/rev/596a3da0c9cb, thanks!

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant