From 4a9f157ac8bc9ad776033ceee6da0b6fe67efe0d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 29 Jan 2026 10:29:55 -0800
Subject: [PATCH] Fixed crash on Windows if the video driver hint isn't set
Fixes https://github.com/libsdl-org/sdl12-compat/issues/390
---
src/SDL12_compat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 7a9c1ba68..8329cf269 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -2799,7 +2799,9 @@ SDL_InitSubSystem(Uint32 sdl12flags)
#ifdef __WINDOWS__
/* DOSBox (and probably other things), try to force the "windib" video
backend, but it doesn't exist in SDL2. Force to "windows" instead. */
- if (videodriver && (SDL20_strcmp(videodriver, "windib") == 0) || (SDL20_strcmp(videodriver, "directx") == 0)) {
+ if (videodriver &&
+ (SDL20_strcmp(videodriver, "windib") == 0 ||
+ SDL20_strcmp(videodriver, "directx") == 0)) {
videodriver = "windows";
}
#endif