From ddb5ab4c44c4f47f9e060a2639bae9c21f4e4006 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 1 May 2022 05:34:21 -0700
Subject: [PATCH] Fixed crash loading webp images if webp.framework isn't
available
---
IMG_webp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/IMG_webp.c b/IMG_webp.c
index 8cd0fac..fa68ca9 100644
--- a/IMG_webp.c
+++ b/IMG_webp.c
@@ -61,7 +61,8 @@ static struct {
if (lib.FUNC == NULL) { SDL_UnloadObject(lib.handle); return -1; }
#else
#define FUNCTION_LOADER(FUNC, SIG) \
- lib.FUNC = FUNC;
+ lib.FUNC = FUNC; \
+ if (lib.FUNC == NULL) { IMG_SetError("Missing webp.framework"); return -1; }
#endif
int IMG_InitWEBP()