From d7d1fdded3ea0974462eb5bd6a61d88140efc3ab 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 a0b2362cc..a02b432cf 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -1403,6 +1403,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);