From 2172c9ddb29cd2bcc5fe06b6483305291aac84a6 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 30 Mar 2024 00:04:42 +0100 Subject: [PATCH] fix overflow check overflowing in R_DrawRepeatMaskedColumn fixes renderer lock ups with transparent textures in software renderer --- src/r_segs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index c531be52..d3fa1c19 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -681,7 +681,7 @@ static void R_DrawRepeatMaskedColumn(column_t *col) { while (sprtopscreen < sprbotscreen) { R_DrawMaskedColumn(col); - if ((INT64)sprtopscreen + dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow + if (sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow sprtopscreen = INT32_MAX; else sprtopscreen += dc_texheight*spryscale;