aboutsummaryrefslogtreecommitdiff
path: root/src/ell_set.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-18 16:57:19 +0200
committerGitHub <noreply@github.com>2019-09-18 16:57:19 +0200
commit72203ca68e123a237c8c748d39131b702ea4b646 (patch)
tree38d1214e399eaaf4e173ad5d13a3820364065c1d /src/ell_set.cpp
parentd2f661fc99615a33d72bb0120a14bca2aaced221 (diff)
parentbc53524cfbde95ecf6bb134984e68eb715d11c2b (diff)
downloadPROJ-72203ca68e123a237c8c748d39131b702ea4b646.tar.gz
PROJ-72203ca68e123a237c8c748d39131b702ea4b646.zip
Merge pull request #1620 from rouault/ossfuzz_17190_and_others
Assorted set of fixes for boring oss-fuzz related errors (mostly divisions by zero in odd situations)
Diffstat (limited to 'src/ell_set.cpp')
-rw-r--r--src/ell_set.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ell_set.cpp b/src/ell_set.cpp
index 0d7fb6d5..d2930ca4 100644
--- a/src/ell_set.cpp
+++ b/src/ell_set.cpp
@@ -389,6 +389,9 @@ static int ellps_spherification (PJ *P) {
return proj_errno_set (P, PJD_ERR_REF_RAD_LARGER_THAN_90);
t = sin (t);
t = 1 - P->es * t * t;
+ if (t == 0.) {
+ return proj_errno_set(P, PJD_ERR_INVALID_ECCENTRICITY);
+ }
if (i==5) /* arithmetic */
P->a *= (1. - P->es + t) / (2 * t * sqrt(t));
else /* geometric */