From b3612f64621e52486b2734741d58b16b0b92f7bc Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 29 Oct 2025 16:26:31 +0000
Subject: [PATCH] testautomation: fixed RLE operation test on big endian
systems
Fixes https://github.com/libsdl-org/SDL/issues/14348
---
test/testautomation_surface.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c
index 8c69faa9a15de..3b11054c4ea9b 100644
--- a/test/testautomation_surface.c
+++ b/test/testautomation_surface.c
@@ -873,6 +873,17 @@ static int SDLCALL surface_testSurfaceRLEPixels(void *arg)
return TEST_ABORTED;
}
+ /* RLE encoding only works for 32-bit surfaces with alpha in the high bits */
+ if (face->format != SDL_PIXELFORMAT_ARGB8888) {
+ tmp = SDL_ConvertSurface(face, SDL_PIXELFORMAT_ARGB8888);
+ SDLTest_AssertCheck(tmp != NULL, "Verify tmp surface is not NULL");
+ if (tmp == NULL) {
+ return TEST_ABORTED;
+ }
+ SDL_DestroySurface(face);
+ face = tmp;
+ }
+
/* Create a temporary surface to trigger RLE encoding during blit */
tmp = SDL_DuplicateSurface(face);
SDLTest_AssertCheck(tmp != NULL, "Verify result from SDL_DuplicateSurface() with RLE pixels is not NULL");