mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
engine.c: prevent an oob access of uwall[] in ceilspritescan().
git-svn-id: https://svn.eduke32.com/eduke32@4810 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
be06b43347
commit
c9943bcde0
1 changed files with 6 additions and 0 deletions
|
@ -6408,6 +6408,12 @@ draw_as_face_sprite:
|
||||||
// to the right of the player. Slowly rotate right toward it. When it
|
// to the right of the player. Slowly rotate right toward it. When it
|
||||||
// just becomes visible, the condition rx == xdim can occur.
|
// just becomes visible, the condition rx == xdim can occur.
|
||||||
|
|
||||||
|
// Don't pointlessly keep going. If the following condition holds, the
|
||||||
|
// ceilspritescan() at the end of our block would not draw any lines,
|
||||||
|
// and moreover may access uwall[] OOB (with x1==xdim).
|
||||||
|
if (rx-1 < lx)
|
||||||
|
return;
|
||||||
|
|
||||||
for (x=lx; x<=rx; x++)
|
for (x=lx; x<=rx; x++)
|
||||||
{
|
{
|
||||||
uwall[x] = max(uwall[x],startumost[x+windowx1]-windowy1);
|
uwall[x] = max(uwall[x],startumost[x+windowx1]-windowy1);
|
||||||
|
|
Loading…
Reference in a new issue