aboutsummaryrefslogtreecommitdiff
path: root/src/projections/geos.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-17 20:45:06 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-09-17 20:45:06 +0200
commit81cb8511161a1f6e03deea064a49a10bf10801e4 (patch)
tree570f56a20b1dda34d7a53970c76af10dbf6ece02 /src/projections/geos.cpp
parent91d23e65ace9872a785f66db756d77e01381556f (diff)
downloadPROJ-81cb8511161a1f6e03deea064a49a10bf10801e4.tar.gz
PROJ-81cb8511161a1f6e03deea064a49a10bf10801e4.zip
geos: avoid division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14666
Diffstat (limited to 'src/projections/geos.cpp')
-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.*/