(hopefully) fix overflow in R_DrawRepeatMaskedColumn

well this fixes the game hanging in software renderer on Marsh´s Marble Zone
This commit is contained in:
Alug committed 2024-01-17 12:11:32 +01:00
1 parent 80a1a97083
commit 4f07372e0f
1 file changed
+1 -1
+1 -1
View File
@@ -690,7 +690,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;