From a60d897eb8b13ec0dc01e62813304e62127140a5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 18 Oct 2025 21:26:23 +0200 Subject: [PATCH] add guard to vid.screens free not super necessary but better safe than sorry --- src/r_draw.h | 1 - src/v_video.c | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/r_draw.h b/src/r_draw.h index cd1356522..175781e4c 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -31,7 +31,6 @@ FUNCINLINE static ATTRINLINE UINT8 *R_Address(INT32 px, INT32 py) return vid.screens[0] + (py + viewwindowy) * vid.width + (viewwindowx + px); } - typedef struct { float x, y, z; } floatv3_t; diff --git a/src/v_video.c b/src/v_video.c index af2755745..ba10f31c1 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -3832,11 +3832,15 @@ void V_Init(void) for (i = 0; i < NUMSCREENS; i++) { + if (vid.screens[i]) + { #if defined(__SSE__) - aligned_free(vid.screens[i]); + aligned_free(vid.screens[i]); #else - free(vid.screens[i]); + free(vid.screens[i]); #endif + } + vid.screens[i] = NULL; }