Skip to content

Commit b3612f6

Browse files
committed
testautomation: fixed RLE operation test on big endian systems
Fixes #14348
1 parent 8b8c515 commit b3612f6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/testautomation_surface.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,17 @@ static int SDLCALL surface_testSurfaceRLEPixels(void *arg)
873873
return TEST_ABORTED;
874874
}
875875

876+
/* RLE encoding only works for 32-bit surfaces with alpha in the high bits */
877+
if (face->format != SDL_PIXELFORMAT_ARGB8888) {
878+
tmp = SDL_ConvertSurface(face, SDL_PIXELFORMAT_ARGB8888);
879+
SDLTest_AssertCheck(tmp != NULL, "Verify tmp surface is not NULL");
880+
if (tmp == NULL) {
881+
return TEST_ABORTED;
882+
}
883+
SDL_DestroySurface(face);
884+
face = tmp;
885+
}
886+
876887
/* Create a temporary surface to trigger RLE encoding during blit */
877888
tmp = SDL_DuplicateSurface(face);
878889
SDLTest_AssertCheck(tmp != NULL, "Verify result from SDL_DuplicateSurface() with RLE pixels is not NULL");

0 commit comments

Comments
 (0)