aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-17 18:45:06 +0000
committerEven Rouault <even.rouault@spatialys.com>2019-09-17 18:45:06 +0000
commit9fc53303984129724bb748d91c3d77b464d14782 (patch)
tree9598855d58133723df00c2b4f527ba425713f32e /src
parentd2ba2915ede37b18c891d433d07bb147afe40925 (diff)
downloadPROJ-9fc53303984129724bb748d91c3d77b464d14782.tar.gz
PROJ-9fc53303984129724bb748d91c3d77b464d14782.zip
geos: avoid division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14666
Diffstat (limited to 'src')
-rw-r--r--src/projections/geos.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/projections/geos.cpp b/src/projections/geos.cpp
index 15f51e6f..7999b21f 100644
--- a/src/projections/geos.cpp
+++ b/src/projections/geos.cpp
@@ -126,11 +126,11 @@ static PJ_LP geos_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse
/* Setting three components of vector from satellite to position.*/
Vx = -1.0;
if(Q->flip_axis) {
- Vz = tan (xy.y / (Q->radius_g - 1.0));
- Vy = tan (xy.x / (Q->radius_g - 1.0)) * sqrt (1.0 + Vz * Vz);
+ Vz = tan (xy.y / Q->radius_g_1);
+ Vy = tan (xy.x / Q->radius_g_1) * sqrt (1.0 + Vz * Vz);
} else {
- Vy = tan (xy.x / (Q->radius_g - 1.0));
- Vz = tan (xy.y / (Q->radius_g - 1.0)) * sqrt (1.0 + Vy * Vy);
+ Vy = tan (xy.x / Q->radius_g_1);
+ Vz = tan (xy.y / Q->radius_g_1) * sqrt (1.0 + Vy * Vy);
}
/* Calculation of terms in cubic equation and determinant.*/