fix overflow check overflowing in R_DrawRepeatMaskedColumn

fixes renderer lock ups with transparent textures in software renderer
This commit is contained in:
Alug 2024-03-30 00:04:42 +01:00
parent 62294dfe35
commit 2172c9ddb2

View file

@ -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;