From a2616778cc06a2f2c42a09da6b6eb4342a6f6d9d Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 27 Dec 2025 15:06:50 +0100 Subject: [PATCH] fix another -Wnull-dereference warning --- src/w_wad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/w_wad.c b/src/w_wad.c index 9be91c8ea..524bd97de 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1998,13 +1998,15 @@ void *W_CachePatchNameRotated(const char *name, INT32 rotationangle, INT32 tag) rspr = (rotsprite_t *)W_GetCachedRotPatchPwad(WADFILENUM(num),LUMPNUM(num)); if (rspr == NULL) - return W_CachePatchNum(W_GetNumForName("MISSING"), tag); + return W_CachePatchNum(num, tag); if (rspr->patches[idx] == NULL) { INT32 xpivot = 0, ypivot = 0; ptr = (patch_t *)W_CachePatchNum(num, PU_PATCH); + if (ptr == NULL) + return W_CachePatchNum(num, tag); // >y pivot centered // >x pivot not centered