sdl12-compat: SDL_DisplayFormat() should check if there's a screen surface first, like 1.2.

From 28b7df68ac0c6fcafb5999df3b81c24c1f2fa8b6 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 27 May 2021 17:27:55 -0400
Subject: [PATCH] SDL_DisplayFormat() should check if there's a screen surface
 first, like 1.2.

---
 src/SDL12_compat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index a9835f5..c61c590 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -3851,6 +3851,11 @@ DECLSPEC SDL12_Surface * SDLCALL
 SDL_DisplayFormat(SDL12_Surface *surface12)
 {
     const Uint32 flags = surface12->flags & (SDL12_SRCCOLORKEY|SDL12_SRCALPHA|SDL12_RLEACCELOK);
+    if (!VideoSurface12) {
+        SDL20_SetError("No video mode has been set");
+        return NULL;
+    }
+
     return SDL_ConvertSurface(surface12, VideoSurface12->format, flags);
 }