mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
engine.c: prevent an oob read in drawsprite_classic() w/ floor-aligned sprites.
git-svn-id: https://svn.eduke32.com/eduke32@4726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
232e479380
commit
737af0387e
1 changed files with 6 additions and 0 deletions
|
@ -6384,6 +6384,12 @@ draw_as_face_sprite:
|
|||
|
||||
lx = ((lmax+65535)>>16);
|
||||
rx = ((rmax+65535)>>16);
|
||||
|
||||
// OOB prevention. Simple test case: have a floor-aligned sprite to the
|
||||
// right of the player. Slowly rotate right toward it. When it just
|
||||
// becomes visible, the condition rx == xdim can occur.
|
||||
rx = min(rx, xdim-1);
|
||||
|
||||
for (x=lx; x<=rx; x++)
|
||||
{
|
||||
uwall[x] = max(uwall[x],startumost[x+windowx1]-windowy1);
|
||||
|
|
Loading…
Reference in a new issue