From df94c55eab3de5e5afb70524ae23c799381d796d Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 15 Dec 2011 22:42:42 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/engine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index cf0064e21..e30206351 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -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