mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-02 05:02:55 +00:00
Drop papersprite draws that are too wide
This prevents an arithmetic overflow when evaluating xscale, resulting in a negative xscale.
This commit is contained in:
parent
3d10278bf2
commit
23b565cec5
1 changed files with 11 additions and 1 deletions
|
|
@ -2081,11 +2081,21 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (x2 < 0)
|
||||
return;
|
||||
|
||||
if ((range = x2 - x1) <= 0)
|
||||
range = x2 - x1;
|
||||
if (range < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
range++; // fencepost problem
|
||||
|
||||
if (range > 32767)
|
||||
{
|
||||
// If the range happens to be too large for fixed_t,
|
||||
// abort the draw to avoid xscale becoming negative due to arithmetic overflow.
|
||||
return;
|
||||
}
|
||||
|
||||
scalestep = ((yscale2 - yscale)/range);
|
||||
|
||||
if (scalestep == 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue