sdl12-compat: Avoid crash if NULL is passed to SDL_RemoveTimer.

From f38ee8ea172a2b156b95bc11d7646e7eeb7909a7 Mon Sep 17 00:00:00 2001
From: Aaron Barany <[EMAIL REDACTED]>
Date: Wed, 27 Jul 2022 23:02:15 -0700
Subject: [PATCH] Avoid crash if NULL is passed to SDL_RemoveTimer.

---
 src/SDL12_compat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 78e4d7e8..45613181 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -7101,8 +7101,8 @@ DECLSPEC SDL_bool SDLCALL
 SDL_RemoveTimer(SDL12_TimerID data)
 {
     /* !!! FIXME:  1.2 will safely return SDL_FALSE if this is a
-     * bogus timer. This code will dereference a bogus pointer. */
-    const SDL_bool retval = SDL20_RemoveTimer(data->timer_id);
+     * bogus timer. This code will dereference a bogus pointer, though it handles NULL. */
+    const SDL_bool retval = data ? SDL20_RemoveTimer(data->timer_id) : SDL_FALSE;
     if (retval) {
         SDL20_free(data);
     }