SDL_image: Really fix https://github.com/libsdl-org/SDL_image/issues/180

From bd37d9aa579e7616712b0a0baf2aceab2c5833cb Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 21 Jul 2021 11:10:10 +0300
Subject: [PATCH] Really fix https://github.com/libsdl-org/SDL_image/issues/180

---
 IMG_gif.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/IMG_gif.c b/IMG_gif.c
index 0e199a8..83ada7b 100644
--- a/IMG_gif.c
+++ b/IMG_gif.c
@@ -581,6 +581,12 @@ ReadImage(SDL_RWops * src, int len, int height, int cmapSize,
     if (!image) {
 	return NULL;
     }
+#ifdef USED_BY_SDL
+    if (!image->pixels) {
+	SDL_FreeSurface(image);
+	return NULL;
+    }
+#endif
 
     for (i = 0; i < cmapSize; i++)
 	ImageSetCmap(image, i, cmap[CM_RED][i],