Skip to content

Commit

Permalink
Merge pull request airbnb#1059 from theill/patch-1
Browse files Browse the repository at this point in the history
Fix out of bound when accessing points
  • Loading branch information
buba447 committed Nov 4, 2019
2 parents 76880a0 + fe4a6dd commit 2f593af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lottie-swift/src/Private/Utility/Extensions/MathKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,13 @@ extension CGPoint: Interpolatable {
}
if accurateDistance < point.distance {
closestPoint = closestPoint - 1
point = points[closestPoint]
pointAmount = CGFloat(closestPoint) * step
nextPointAmount = pointAmount + step
if closestPoint < 0 {
foundPoint = true
continue
}
point = points[closestPoint]
pointAmount = CGFloat(closestPoint) * step
nextPointAmount = pointAmount + step
continue
}

Expand Down

0 comments on commit 2f593af

Please sign in to comment.