Skip to content

ArrayIndexOutOfBoundsException in AutoLayout.InterpolateDynamicProperty #1532

Closed
@stuchl4n3k

Description

See while loop at the line 335 at https://github.com/gephi/gephi/blob/master/modules/LayoutPlugin/src/main/java/org/gephi/layout/plugin/AutoLayout.java#L335:

while (thresholds[currentIndex] < ratio && currentIndex < thresholds.length) {
    currentIndex++;
}

Please switch the order of those conditions, otherwise it can cause access to thresholds[thresholds.length] resulting in:

java.lang.ArrayIndexOutOfBoundsException: 2
    at org.gephi.layout.plugin.AutoLayout$InterpolateDynamicProperty.getValue(AutoLayout.java:335)
    at org.gephi.layout.plugin.AutoLayout.setProperties(AutoLayout.java:138)
    at org.gephi.layout.plugin.AutoLayout.execute(AutoLayout.java:124)

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions