Skip to content

Commit

Permalink
Fixed bug 4999 - Palette surface always promoted to alpha (Thanks Cam…
Browse files Browse the repository at this point in the history
…eron Gutman!)

MSVC Static analysis: Incorrect alpha_value check in SDL_render.c
(see also bug 4425)
  • Loading branch information
1bsyl committed Feb 23, 2020
1 parent dd1d8ab commit 9a7c2b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/SDL_render.c
Expand Up @@ -1167,7 +1167,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
if (fmt->palette) {
for (i = 0; i < fmt->palette->ncolors; i++) {
Uint8 alpha_value = fmt->palette->colors[i].a;
if (alpha_value != 0 || alpha_value != SDL_ALPHA_OPAQUE) {
if (alpha_value != 0 && alpha_value != SDL_ALPHA_OPAQUE) {
needAlpha = SDL_TRUE;
break;
}
Expand Down

0 comments on commit 9a7c2b2

Please sign in to comment.