https://github.com/libsdl-org/SDL_image/commit/f1ed91538fe2b793b11080cc76211ff8b4478713
From f1ed91538fe2b793b11080cc76211ff8b4478713 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 8 Jan 2025 11:49:47 -0800
Subject: [PATCH] Fixed crash loading webp files when out of memory
---
src/IMG_webp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/IMG_webp.c b/src/IMG_webp.c
index 328d8375..71b1d0e4 100644
--- a/src/IMG_webp.c
+++ b/src/IMG_webp.c
@@ -329,6 +329,9 @@ IMG_Animation *IMG_LoadWEBPAnimation_IO(SDL_IOStream *src)
anim->count = lib.WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
anim->frames = (SDL_Surface **)SDL_calloc(anim->count, sizeof(*anim->frames));
anim->delays = (int *)SDL_calloc(anim->count, sizeof(*anim->delays));
+ if (!anim->frames || !anim->delays) {
+ goto error;
+ }
canvas = SDL_CreateSurface(anim->w, anim->h, features.has_alpha ? SDL_PIXELFORMAT_RGBA32 : SDL_PIXELFORMAT_RGBX32);
if (!canvas) {