SDL_image: Fixed saving ANI files on big endian systems

From fd5932b8591d14d64d5f2253b210f5397c6da2ee Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 21 Jan 2026 19:13:28 +0000
Subject: [PATCH] Fixed saving ANI files on big endian systems

---
 src/IMG_ani.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/IMG_ani.c b/src/IMG_ani.c
index fb681d4f..a494aec3 100644
--- a/src/IMG_ani.c
+++ b/src/IMG_ani.c
@@ -601,11 +601,11 @@ static bool WriteAnimation(IMG_AnimationEncoder *encoder)
 
     ANIHEADER anih;
     SDL_zero(anih);
-    anih.cbSizeof = sizeof(anih);
-    anih.frames = ctx->num_frames;
-    anih.steps = ctx->num_frames;
-    anih.jifRate = 1;
-    anih.fl = ANI_FLAG_ICON;
+    anih.cbSizeof = SDL_Swap32LE(sizeof(anih));
+    anih.frames = SDL_Swap32LE(ctx->num_frames);
+    anih.steps = SDL_Swap32LE(ctx->num_frames);
+    anih.jifRate = SDL_Swap32LE(1);
+    anih.fl = SDL_Swap32LE(ANI_FLAG_ICON);
     result &= (SDL_WriteIO(dst, &anih, sizeof(anih)) == sizeof(anih));
 
     // Info list