Skip to content

Commit f57336a

Browse files
Fixed infinite loop bug in C# code (550).
1 parent 072ecd7 commit f57336a

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/ImageSharp.Drawing/Shapes/PolygonClipper/PolygonClipper.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,9 @@ private void ConvertHorzSegsToJoins()
333333
for (int j = i + 1; j < k; j++)
334334
{
335335
HorzSegment hs2 = this.horzSegList[j];
336-
if (hs2.LeftOp.Point.X >= hs1.RightOp.Point.X)
337-
{
338-
break;
339-
}
340-
341-
if (hs2.LeftToRight == hs1.LeftToRight ||
342-
(hs2.RightOp.Point.X <= hs1.LeftOp.Point.X))
336+
if ((hs2.LeftOp.Point.X >= hs1.RightOp.Point.X) ||
337+
(hs2.LeftToRight == hs1.LeftToRight) ||
338+
(hs2.RightOp.Point.X <= hs1.LeftOp.Point.X))
343339
{
344340
continue;
345341
}
@@ -674,7 +670,7 @@ private void DoHorizontal(Active horz)
674670

675671
if (IsHotEdge(horz))
676672
{
677-
AddOutPt(horz, horz.Top);
673+
this.AddToHorzSegList(AddOutPt(horz, horz.Top));
678674
}
679675

680676
this.UpdateEdgeIntoAEL(horz); // this is the end of an intermediate horiz.

0 commit comments

Comments
 (0)