]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix for a crash in certain q1bsp maps with very large polygons when
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 3 Dec 2008 00:34:17 +0000 (00:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 3 Dec 2008 00:34:17 +0000 (00:34 +0000)
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

gl_rsurf.c

index 21f5e4c50b8a2424dcb60d9f07b728f0c482957c..dfe530ebac9bb1ffdd1b4a59e848c38696d1f857 100644 (file)
@@ -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