From 97497fa1a1b058bad530e45fec459dfd2d92c63a Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 16 Dec 2022 18:56:52 -0800 Subject: [PATCH] Guard against out of bounds sprite brightmap --- src/r_things.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 6f1dd436a..90b5cc1db 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -889,6 +889,13 @@ static void R_DrawVisSprite(vissprite_t *vis) if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto } + // Prevent an out of bounds error + if (bmpatch && (bmpatch->width != patch->width || + bmpatch->height != patch->height)) + { + return; + } + R_SetColumnFunc(BASEDRAWFUNC, false); // hack: this isn't resetting properly somewhere. dc_colormap = vis->colormap; dc_fullbright = colormaps;