vis: fix stack separator cache overflow check

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-04-21 10:10:13 +09:30
parent fa93a21598
commit 186ca8863b
1 changed files with 3 additions and 2 deletions

View File

@ -125,9 +125,10 @@ ClipToSeperators(const winding_t *source,
/* Cache separating planes for tests 0, 1 */
if (test < 2) {
stack->separators[test][stack->numseparators[test]] = sep;
if (++stack->numseparators[test] >= MAX_SEPARATORS)
if (stack->numseparators[test] == MAX_SEPARATORS)
Error("MAX_SEPARATORS");
stack->separators[test][stack->numseparators[test]] = sep;
stack->numseparators[test]++;
}
target = ClipStackWinding(target, stack, &sep);