SDL: Validate first_binding in SDL_BindGPUVertexBuffers (#16493)

From 930cd0dbf8d1b6fdc5b91711d8d71542c1df0960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Josip=20Komljenovi=C4=87?= <[EMAIL REDACTED]>
Date: Sun, 11 Oct 2026 22:48:19 +0200
Subject: [PATCH] Validate first_binding in SDL_BindGPUVertexBuffers (#16493)

---
 src/gpu/SDL_gpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c
index 12939c2d9e0dd..e2729684ef578 100644
--- a/src/gpu/SDL_gpu.c
+++ b/src/gpu/SDL_gpu.c
@@ -2060,6 +2060,10 @@ void SDL_BindGPUVertexBuffers(
         SDL_InvalidParamError("bindings");
         return;
     }
+    CHECK_PARAM(first_binding + num_bindings > MAX_VERTEX_BUFFERS) {
+        SDL_SetError("first_binding + num_bindings exceeds MAX_VERTEX_BUFFERS");
+        return;
+    }
 
     if (RENDERPASS_DEVICE->debug_mode) {
         CHECK_RENDERPASS