diff --git a/changelog.txt b/changelog.txt index 24ba90ad..322757e7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Unreleased * qbsp: fixed surface edge corruption when using skip surfaces * qbsp: added "-noskip" option for troubleshooting skip related problems +* vis: fix portal stack corruption in ClipStackWinding * bsputil: added a "--check" option to check internal data consistency 2013-04-10 TyrUtils v0.7 diff --git a/vis/vis.c b/vis/vis.c index 64480539..d79af645 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -308,6 +308,13 @@ ClipStackWinding(winding_t *in, pstack_t *stack, plane_t *split) if (sides[i + 1] == SIDE_ON || sides[i + 1] == sides[i]) continue; + if (neww->numpoints == MAX_WINDING_FIXED) { + /* Can't clip, fall back to original */ + FreeStackWinding(neww, stack); + c_noclip++; + return in; + } + // generate a split point p2 = in->points[(i + 1) % in->numpoints];