google / google/s2-geometry-library-java

Infinite loop in coverer builder

Aperta
#55 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
587
Fork
231
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

```
S2RegionCoverer coverer = S2RegionCoverer.builder()
.setMinLevel(20)
.setMaxLevel(10)
.build();
S2Cap cap = S2Cap.fromAxisAngle(new S2Point(1, 0, 0), S1Angle.degrees(5));
S2CellUnion covering = coverer.getCovering(cap); // OutOfMemoryError
```

The coverer keeps trying to refine cells to reach minLevel(20), but maxLevel(10) prevents going past level 10, so it never satisfies the min level constraint and spirals until the JVM runs out of heap. Could be prevented by checking that min < max

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.