SDL: Prevent asan warning on qsort(): (f1bc5)

From f1bc5f305cb31a177a58495292d6f782a93a6efb Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Sat, 20 Jan 2024 06:42:00 +0100
Subject: [PATCH] Prevent asan warning on qsort():
 'src/stdlib/SDL_qsort.c:27:5: runtime error: null pointer passed as argument
 1, which is declared to never be null`

(cherry picked from commit 2cd583ee13ec4660d7fbe6e6d8293744d3343071)
---
 src/stdlib/SDL_qsort.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c
index 70962dda045b..0e5728ad3323 100644
--- a/src/stdlib/SDL_qsort.c
+++ b/src/stdlib/SDL_qsort.c
@@ -30,6 +30,9 @@
 #if defined(HAVE_QSORT)
 void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *))
 {
+    if (!base) {
+        return;
+    }
     qsort(base, nmemb, size, compare);
 }