From a13913bebd12d71266c2e4fb317b6cffce8a76c2 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 14 Feb 2023 01:05:48 -0800 Subject: [PATCH] Fix R_CacheSpriteBrightMap trying to cache out of range lump --- src/r_things.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index ca1e3dafd..171ed6746 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1232,7 +1232,14 @@ static patch_t *R_CacheSpriteBrightMap(const spriteinfo_t *sprinfo, UINT8 frame) name = sprinfo->bright[SPRINFO_DEFAULT_PIVOT]; } - return W_CachePatchNum(W_CheckNumForLongName(name), PU_SPRITE); + const lumpnum_t num = W_CheckNumForLongName(name); + + if (num == LUMPERROR) + { + return NULL; + } + + return W_CachePatchNum(num, PU_SPRITE); } //