X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=svbsp.c;h=1ad7fafc82248c7826c96da409514800468c1fa4;hp=f22947b805e007035e5bd4e5c45247cc5a466289;hb=00b6d96fd1220b1df82036c445389ae19a08709e;hpb=dc6656290bde80d3c6f4bb184027908ea645e4fc diff --git a/svbsp.c b/svbsp.c index f22947b8..1ad7fafc 100644 --- a/svbsp.c +++ b/svbsp.c @@ -1,7 +1,7 @@ -// Shadow Volume BSP code written by Forest "LordHavoc" Hale on 2003-11-06 and placed into public domain. -// Modified by LordHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25 -// Optimized by LordHavoc on 2009-12-24 and 2009-12-25 +// Shadow Volume BSP code written by Ashley Rose Hale (LadyHavoc) on 2003-11-06 and placed into public domain. +// Modified by LadyHavoc (to make it work and other nice things like that) on 2007-01-24 and 2007-01-25 +// Optimized by LadyHavoc on 2009-12-24 and 2009-12-25 #include #include @@ -409,6 +409,9 @@ int SVBSP_AddPolygon(svbsp_t *b, int numpoints, const float *points, int inserto // note we still allow points and lines to be tested... if (numpoints < 1) return 0; + // if the polygon has too many points, we would crash + if (numpoints > MAX_SVBSP_POLYGONPOINTS) + return 0; poly.numpoints = numpoints; for (i = 0;i < numpoints;i++) {