mousebird / WhirlyGlobe-3

WhirlyGlobe-Maply 3.0 Implementation
Other
11 stars 6 forks source link

(iOS) MaplyVectorObject .linearMiddle() crashes #7

Closed dragonikpl closed 4 years ago

dragonikpl commented 4 years ago

Tested on latest develop using Cocoapods. Sample code:

let coordinates: UnsafeMutablePointer<MaplyCoordinate> = UnsafeMutablePointer<MaplyCoordinate>.allocate(capacity: 4)
coordinates[0] = MaplyCoordinate(x: 0.1, y: 0.1)
coordinates[1] = MaplyCoordinate(x: 0.2, y: 0.2)
coordinates[2] = MaplyCoordinate(x: 0.3, y: 0.3)
coordinates[3] = MaplyCoordinate(x: 0.4, y: 0.4)

let vector = MaplyVectorObject(lineString: coordinates, numCoords: Int32(4), attributes: nil)
let middle = vector.linearMiddle(MaplySphericalMercator(webStandard: ()))

Crash happens in VectorObject.cpp on line 353

image

mousebird commented 4 years ago

Good catch. Should be fixed in develop.