Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6d2c04e2
Unverified
Commit
6d2c04e2
authored
Apr 09, 2018
by
Don Gagne
Committed by
GitHub
Apr 09, 2018
Browse files
Merge pull request #6331 from DonLakeFlyer/TerrainCrashGuard
Guard against crash in terrain code
parents
556599a3
ce4169b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/TerrainTile.cc
View file @
6d2c04e2
...
...
@@ -114,6 +114,10 @@ double TerrainTile::elevation(const QGeoCoordinate& coordinate) const
// Get the index at resolution of 1 arc second
int
indexLat
=
_latToDataIndex
(
coordinate
.
latitude
());
int
indexLon
=
_lonToDataIndex
(
coordinate
.
longitude
());
if
(
indexLat
==
-
1
||
indexLon
==
-
1
)
{
qCWarning
(
TerrainTileLog
)
<<
"Internal error indexLat:indexLon == -1"
<<
indexLat
<<
indexLon
;
return
-
1.0
;
}
qCDebug
(
TerrainTileLog
)
<<
"indexLat:indexLon"
<<
indexLat
<<
indexLon
<<
"elevation"
<<
_data
[
indexLat
][
indexLon
];
return
static_cast
<
double
>
(
_data
[
indexLat
][
indexLon
]);
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment