Ticket #16472: 16472.AIOOBE.patch

File 16472.AIOOBE.patch, 993 bytes (added by taylor.smock, 5 years ago)
  • src/org/openstreetmap/josm/gui/util/imagery/CameraPlane.java

    diff --git a/src/org/openstreetmap/josm/gui/util/imagery/CameraPlane.java b/src/org/openstreetmap/josm/gui/util/imagery/CameraPlane.java
    index 620f9eb940..f3b9334a32 100644
    a b public class CameraPlane {  
    160160    public void setRotationFromDelta(final Point from, final Point to) {
    161161        // Bound check (bounds are essentially the image viewer component)
    162162        if (from.x < 0 || from.y < 0 || to.x < 0 || to.y < 0
    163             || from.x > this.vectors.length || from.y > this.vectors[0].length
    164             || to.x > this.vectors.length || to.y > this.vectors[0].length) {
     163            || from.x > this.vectors.length - 1 || from.y > this.vectors[from.x].length - 1
     164            || to.x > this.vectors.length - 1 || to.y > this.vectors[to.x].length - 1) {
    165165            return;
    166166        }
    167167        Vector3D f1 = this.vectors[from.x][from.y];