Keep from getting stuck in an infinite loop

This commit is contained in:
Eric Fischer 2016-03-21 17:23:34 -07:00
parent a989611515
commit 4fc6ca3c3b

View File

@ -1640,8 +1640,13 @@ void Clipper::FixHoleLinkage(OutRec &outrec)
outrec.FirstLeft->Pts)) return; outrec.FirstLeft->Pts)) return;
OutRec* orfl = outrec.FirstLeft; OutRec* orfl = outrec.FirstLeft;
while (orfl && ((orfl->IsHole == outrec.IsHole) || !orfl->Pts)) OutRec* first = orfl;
while (orfl && ((orfl->IsHole == outrec.IsHole) || !orfl->Pts)) {
orfl = orfl->FirstLeft; orfl = orfl->FirstLeft;
if (orfl == first) {
break;
}
}
outrec.FirstLeft = orfl; outrec.FirstLeft = orfl;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------