From cf4cc3fa935e33456f3bcc0108b64820f3a5903d Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Tue, 8 Feb 2022 17:20:50 +0900 Subject: [PATCH] add null-check on fill_special_room() Add null-check of croom before its first use. --- src/sp_lev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 7efbb091a..f2ee11783 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2588,6 +2588,9 @@ fill_special_room(struct mkroom* croom) { int i; + if (!croom) + return; + /* First recurse into subrooms. We don't want to block an ordinary room with * a special subroom from having the subroom filled, or an unfilled outer * room preventing a special subroom from being filled. */ @@ -2595,7 +2598,7 @@ fill_special_room(struct mkroom* croom) fill_special_room(croom->sbrooms[i]); } - if (!croom || croom->rtype == OROOM || croom->rtype == THEMEROOM + if (croom->rtype == OROOM || croom->rtype == THEMEROOM || croom->needfill == FILL_NONE) return; -- 2.50.1