mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-07 23:42:40 +00:00
Clamp ds_bgofs in sw water ripples to fix crash
This commit is contained in:
parent
96af259c50
commit
210186d8f2
1 changed files with 5 additions and 0 deletions
|
|
@ -13,6 +13,8 @@
|
|||
/// while maintaining a per column clipping list only.
|
||||
/// Moreover, the sky areas have to be determined.
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "console.h"
|
||||
#include "g_game.h"
|
||||
|
|
@ -225,6 +227,9 @@ static void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
|||
ds_x1 = x1;
|
||||
ds_x2 = x2;
|
||||
|
||||
// ds_bgofs must not cause an out-of-bounds read
|
||||
ds_bgofs = std::clamp(ds_bgofs, -ds_y, vid.height - ds_y - 1);
|
||||
|
||||
spanfunc();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue