sdl2-compat: SDL_RenderGeometryRaw: check the return value of SDL_small_alloc()

From e6c07f5dac882166d018eb1be91fb951cfd2d2ee Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 31 Jan 2024 23:23:20 +0300
Subject: [PATCH] SDL_RenderGeometryRaw: check the return value of
 SDL_small_alloc()

---
 src/sdl2_compat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 809acb2..1d53c61 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4284,6 +4284,9 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float
     }
 
     color3 = (SDL_FColor *) SDL3_small_alloc(SDL_FColor, num_vertices, &isstack);
+    if (!color3) {
+        return SDL3_OutOfMemory();
+    }
     for (i = 0; i < num_vertices; ++i) {
         color3[i].r = color->r / 255.0f;
         color3[i].g = color->g / 255.0f;