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:
helixhorned 2014-12-13 22:33:02 +00:00
parent be06b43347
commit c9943bcde0

View file

@ -6408,6 +6408,12 @@ draw_as_face_sprite:
// to the right of the player. Slowly rotate right toward it. When it
// 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++)
{
uwall[x] = max(uwall[x],startumost[x+windowx1]-windowy1);