X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=svbsp.c;h=437d82a3b935302a32ebc9a8f4747899d326f4bf;hb=bca36f0405cd976d105a3a43542193ed81925247;hp=f22947b805e007035e5bd4e5c45247cc5a466289;hpb=dc6656290bde80d3c6f4bb184027908ea645e4fc;p=xonotic%2Fdarkplaces.git diff --git a/svbsp.c b/svbsp.c index f22947b8..437d82a3 100644 --- a/svbsp.c +++ b/svbsp.c @@ -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++) {