check array size before accessing next element (fixes aspire map crash)

This commit is contained in:
yugecin 2016-12-09 22:16:42 +01:00
parent fd8474365d
commit 5f9f68c6e8

View File

@ -109,6 +109,11 @@ public abstract class EqualDistanceMultiCurve extends Curve {
// if (hitObject.getRepeatCount() > 1) {
Vec2f c1 = curve[0];
int cnt = 1;
if (cnt > ncurve) {
return;
}
Vec2f c2 = curve[cnt++];
while (cnt <= ncurve && c2.cpy().sub(c1).len() < 1)
c2 = curve[cnt++];