From a06aa1590ffb6e3178ef9110ac3003ec7c9fcbb0 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 16 Oct 2025 13:39:35 +0200 Subject: [PATCH] add allocation failure case in R_DrawMasked --- src/r_things.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r_things.cpp b/src/r_things.cpp index 3b8e69808..0b332bff0 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -3857,6 +3857,9 @@ void R_DrawMasked(maskcount_t* masks, INT32 nummasks) heads = static_cast(calloc(nummasks, sizeof(drawnode_t))); + if (!heads) + I_Error("R_DrawMasked: No more free memory\n"); + for (i = 0; i < nummasks; i++) { heads[i].next = heads[i].prev = &heads[i];