From f8a7ba4a75dc7860a4fef942c6b6bc702c8f767d Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sun, 2 Jun 2024 16:54:11 -0300 Subject: [PATCH] Prevent infinite loop in R_RenderThickSideRange --- src/r_segs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index d68db60de..d7296583c 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -469,7 +469,7 @@ static void R_DrawRepeatMaskedColumn(column_t *col, unsigned lengthcol) R_DrawMaskedColumn(col, lengthcol); - if ((INT64)topscreen + (INT64)texheight > (INT64)INT32_MAX) // prevent overflow + if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow break; topscreen += texheight; @@ -504,7 +504,7 @@ static void R_DrawRepeatFlippedMaskedColumn(column_t *col, unsigned lengthcol) R_DrawFlippedMaskedColumn(col, lengthcol); - if ((INT64)topscreen + (INT64)texheight > (INT64)INT32_MAX) // prevent overflow + if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow break; topscreen += texheight;