SDL_image: Fixed partial alpha in ICO and CUR images

From be3ddf22568dd31aa88ba7461ad06638d22ed04e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 10 Feb 2025 11:30:53 -0800
Subject: [PATCH] Fixed partial alpha in ICO and CUR images

Fixes https://github.com/libsdl-org/SDL_image/issues/518
---
 CHANGES.txt   | 3 +++
 src/IMG_bmp.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 5084189ba..81cb802f4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,6 @@
+3.2.2:
+ * Fixed partial alpha in ICO and CUR images
+
 3.0.0:
  * Added support for loading HDR AVIF images
  * Added AVIF save support:
diff --git a/src/IMG_bmp.c b/src/IMG_bmp.c
index dafa9eaf8..82b431b0c 100644
--- a/src/IMG_bmp.c
+++ b/src/IMG_bmp.c
@@ -403,7 +403,7 @@ LoadICOCUR_IO(SDL_IOStream * src, int type, bool closeio)
                     goto done;
                 }
             }
-            *((Uint32 *) bits + i) |= ((pixel >> shift) ? 0 : 0xFF000000);
+            *((Uint32 *) bits + i) &= ((pixel >> shift) ? 0 : 0xFFFFFFFF);
             pixel <<= ExpandBMP;
         }
         /* Skip padding bytes, ugh */