SDL_image: Fixed warning building with Visual Studio

From 67ef382c135f178e2c0617561f2486bd75efe25f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 19 Jun 2022 12:18:33 -0700
Subject: [PATCH] Fixed warning building with Visual Studio

---
 IMG_jxl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/IMG_jxl.c b/IMG_jxl.c
index 393fceba..d16c9d85 100644
--- a/IMG_jxl.c
+++ b/IMG_jxl.c
@@ -199,7 +199,11 @@ SDL_Surface *IMG_LoadJXL_RW(SDL_RWops *src)
                 SDL_OutOfMemory();
                 goto done;
             }
-            pitch = outputsize / info.ysize;
+            if ((outputsize / info.ysize) > SDL_MAX_SINT32) {
+                SDL_OutOfMemory();
+                goto done;
+            }
+            pitch = (int)(outputsize / info.ysize);
             if (lib.JxlDecoderSetImageOutBuffer(decoder, &format, pixels, outputsize) != JXL_DEC_SUCCESS) {
                 IMG_SetError("Couldn't set JXL output buffer");
                 goto done;