sdl12-compat: events: Drop mouse motion if screen surface isn't available yet.

From 9618d03fee48f31ccb623a8210e4e94c534189ff Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 30 Sep 2022 15:22:58 -0400
Subject: [PATCH] events: Drop mouse motion if screen surface isn't available
 yet.

Reference Issue #215.
---
 src/SDL12_compat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 3c9272fc..796d7b53 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -4533,6 +4533,10 @@ EventFilter20to12(void *data, SDL_Event *event20)
         }
 
         case SDL_MOUSEMOTION:
+            if (!VideoSurface12) {
+                return 1;  /* we don't have a screen surface yet? Don't send this on to the app. */
+            }
+
             event12.type = SDL12_MOUSEMOTION;
             event12.motion.which = (Uint8) event20->motion.which;
             event12.motion.state = event20->motion.state;