From 281265f7775de36ffd8fa870a3e70782547ed13c Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 23 Jan 2023 19:18:19 +0000 Subject: [PATCH] AM_MinimapGenerate: return NULL if malloc fails --- src/am_map.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/am_map.c b/src/am_map.c index 7193005a8..314d3ad8c 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -1406,6 +1406,9 @@ minigen_t *AM_MinimapGenerate(INT32 wh) ret.h = f_h; am_buf = ret.buf = malloc((f_w*f_h)); + if (ret.buf == NULL) + return NULL; + //AM_clearFB(BACKGROUND); memset(am_buf, 0xff, (f_w*f_h)); AM_drawWalls(PASS_FOF);