SDL_image: stb_image.h: fix build in C90 mode. (bceb9)

From bceb94e78f758516cd6acf7e6c8899da65ed2d34 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 16 Oct 2023 20:55:50 +0300
Subject: [PATCH] stb_image.h: fix build in C90 mode.

---
 src/stb_image.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/stb_image.h b/src/stb_image.h
index eaeff8a3..155d385b 100644
--- a/src/stb_image.h
+++ b/src/stb_image.h
@@ -1336,13 +1336,14 @@ static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int byt
 
 static unsigned char *stbi__load_indexed(stbi__context *s, int *x, int *y, unsigned int *palette_buffer, int palette_buffer_len)
 {
-   if (!palette_buffer)
-       return NULL;
-
    stbi__result_info ri;
    int comp;
-   void *result = stbi__load_main(s, x, y, &comp, 1, &ri, 8, palette_buffer, palette_buffer_len);
+   void *result;
+
+   if (!palette_buffer)
+       return NULL;
 
+   result = stbi__load_main(s, x, y, &comp, 1, &ri, 8, palette_buffer, palette_buffer_len);
    if (result == NULL)
       return NULL;