From 9a7c2b2246b89e5318e8f5edded76072fb135600 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sun, 23 Feb 2020 09:59:52 +0100 Subject: [PATCH] Fixed bug 4999 - Palette surface always promoted to alpha (Thanks Cameron Gutman!) MSVC Static analysis: Incorrect alpha_value check in SDL_render.c (see also bug 4425) --- src/render/SDL_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ff7d247d9..59c2f4992 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -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; }