Patch up out-of-bounds access in some voxel drawing code.

git-svn-id: https://svn.eduke32.com/eduke32@2181 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-12-15 22:42:42 +00:00
parent 46ed3313e7
commit df94c55eab

View file

@ -5082,7 +5082,10 @@ static void drawvox(int32_t dasprx, int32_t daspry, int32_t dasprz, int32_t dasp
rx -= lx;
l1 = distrecip[(ny-yoff)>>14];
l2 = distrecip[(ny+yoff)>>14];
// FIXME! AMCTC RC2/beta shotgun voxel
// (e.g. training map right after M16 shooting):
l2 = clamp((ny+yoff)>>14, 0, 65535);
l2 = distrecip[l2];
for (; voxptr<voxend; voxptr+=voxptr[1]+3)
{
j = (voxptr[0]<<15)-syoff;