Bug 365009

Summary: Crash with AzimuthalEquidistantProjection and calculation of x,y for labels
Product: [Applications] marble Reporter: Friedrich W. H. Kossebau <kossebau>
Component: generalAssignee: marble-bugs
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Stack trace on crash

Description Friedrich W. H. Kossebau 2016-07-02 17:28:54 UTC
Marble crashed. You suck!

Reproducible: Always

Steps to Reproduce:
1. Open Marble, use OSM map theme, mercator view
2. Enter "11° 17' 23,0"E,  51° 59' 12,6"N" in Search field and press Enter
3. Keep search result and it's label in the view
4. Select "Azimuthal Equidistant"

Actual Results:  
Boom.

Expected Results:  
No boom.

The crash results from x & y being NaNs. They are because there is a division by 0 in
bool AzimuthalEquidistantProjection::screenCoordinates( const GeoDataCoordinates &coordinates,
                                             const ViewportParams *viewport,
                                             qreal &x, qreal &y, bool &globeHidesPoint ) const
For some reason cosC becomes 1, so c becomes 0 , so k gets NaN (due to divide by 0), thus x & y get NaN.
No clue about the calculations happening there, so no idea what the fix would be.
Comment 1 Friedrich W. H. Kossebau 2016-07-02 17:29:52 UTC
Created attachment 99809 [details]
Stack trace on crash
Comment 2 Friedrich W. H. Kossebau 2016-07-05 20:59:41 UTC
Fixed by tackat with 251a9f66a39241d71b6567e2724a3a26368f5932