Fix sprtopscreen from getting integer overflows once and for all in R_DrawRepeatMaskedColumn
Fixes TD's terminal from freezing the game this time, oh boy
This commit is contained in:
1 parent
66a45c653a
commit
72bd3e28ed
1 file changed
+4
-1
+4
-1
@@ -708,7 +708,10 @@ static void R_DrawRepeatMaskedColumn(column_t *col)
|
||||
{
|
||||
while (sprtopscreen < sprbotscreen) {
|
||||
R_DrawMaskedColumn(col);
|
||||
sprtopscreen += dc_texheight*spryscale;
|
||||
if ((INT64)sprtopscreen + dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
|
||||
sprtopscreen = INT32_MAX;
|
||||
else
|
||||
sprtopscreen += dc_texheight*spryscale;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user