From 90cc5a6cb0cf0f210d2a8c3518dbe73c429b29ff Mon Sep 17 00:00:00 2001 From: alufolie91 Date: Mon, 4 Sep 2023 15:30:21 +0200 Subject: [PATCH] Fix a possible crash in R_RenderMaskedSegRange https://git.do.srb2.org/STJr/SRB2/-/commit/55b4458001b2ffe76774ff07a11b56ebf1f70de9 --- src/r_segs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r_segs.c b/src/r_segs.c index 594024b75..53f12ecc6 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1769,6 +1769,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) while (need > maxopenings); openings = Z_Realloc(openings, maxopenings * sizeof (*openings), PU_STATIC, NULL); lastopening = openings + pos; + + if (oldopenings == NULL) + return; // borrowed fix from *cough* zdoom *cough* // [RH] We also need to adjust the openings pointers that