From: havoc Date: Wed, 3 Dec 2008 00:34:17 +0000 (+0000) Subject: fix for a crash in certain q1bsp maps with very large polygons when X-Git-Tag: xonotic-v0.1.0preview~2028 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=40ab2dfbc272bc92c2951e175a52d508b7328bfe;p=xonotic%2Fdarkplaces.git fix for a crash in certain q1bsp maps with very large polygons when cl_stainmaps is on, thanks to Andreas Dehmel for this fix git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8562 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index 21f5e4c5..dfe530eb 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -216,7 +216,7 @@ loc0: s = bound(0, impacts, smax * 16) - impacts; t = bound(0, impactt, tmax * 16) - impactt; i = (int)(s * s + t * t + dist2); - if (i > maxdist) + if ((i > maxdist) || (smax > sizeof(sdtable)/sizeof(sdtable[0]))) // smax overflow fix from Andreas Dehmel continue; // reduce calculations