memononen/recastnavigation — pull request #15 by axelrodR (2014-01-21 22:30:49+00:00)
Title: bugfix: divPoly caused a stack overrun by producing an 8th point

Testing over many maps has paid off...
divPoly could produce an 8th point after several calls because some of the old clipPoly code on which it was based. The old function can add the same point twice consecutively (interpolation+adding the point). It caused no harm back than, but it does now.
Rather than raising the buffer size I rewrote divPoly to avoid adding the same point twice. Code is similar exepct it deals with the additions of ina!=inb slightly differently than ina==inb.