Commit 572dfb4f6e4aa0dcaab0a501ac65a4a81f76e81c

Sam Lantinga 2021-05-07T12:28:27

Merge commit 'c93e3b36074ddb2ed986cbacc5e9d4f3a60db343' into main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c
index 32cf8e0..3f3b62c 100644
--- a/src/video/SDL_RLEaccel.c
+++ b/src/video/SDL_RLEaccel.c
@@ -1423,9 +1423,12 @@ SDL_RLESurface(SDL_Surface * surface)
         return -1;
     }
 
-    /* If we don't have colorkey or blending, nothing to do... */
-    flags = surface->map->info.flags;
-    if (!(flags & (SDL_COPY_COLORKEY | SDL_COPY_BLEND))) {
+    if (flags & SDL_COPY_COLORKEY) {
+        /* ok */
+    } else if ((flags & SDL_COPY_BLEND) && surface->format->Amask) {
+        /* ok */
+    } else {
+        /* If we don't have colorkey or blending, nothing to do... */
         return -1;
     }