From 6ec51e6b9e2d2ebc2b7c39f22c44a5d581bdece1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 15 Apr 2022 01:24:56 +0300
Subject: [PATCH] check for NULL VideoRenderer in PresentScreen()
fixes segfault from tucnak. (ref. issue: #182.)
---
src/SDL12_compat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index ff33fc2..db22c30 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -5826,6 +5826,10 @@ SDL_DisplayFormatAlpha(SDL12_Surface *surface12)
static void
PresentScreen(void)
{
+ if (!VideoRenderer20) {
+ return;
+ }
+
SDL20_RenderClear(VideoRenderer20);
SDL20_RenderCopy(VideoRenderer20, VideoTexture20, NULL, NULL);