aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2019-03-21 13:53:01 +0100
committerGitHub <noreply@github.com>2019-03-21 13:53:01 +0100
commitbf14355080cf7d8cf7e4b3342263ae7f22660e58 (patch)
treed73eba3ecb0347d7131b25527aa496351c8434a1 /src
parent5d74522573291a8af698acf3102a662eb3a675eb (diff)
parentab19f0d7aec223b89537d07d5f5f3f2e1f5db822 (diff)
downloadPROJ-bf14355080cf7d8cf7e4b3342263ae7f22660e58.tar.gz
PROJ-bf14355080cf7d8cf7e4b3342263ae7f22660e58.zip
Merge pull request #1340 from rouault/fix_ossfuzz_13827
aea: avoid division by zero
Diffstat (limited to 'src')
-rw-r--r--src/projections/aea.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp
index f457e836..8a80c49c 100644
--- a/src/projections/aea.cpp
+++ b/src/projections/aea.cpp
@@ -180,6 +180,10 @@ static PJ *setup(PJ *P) {
return destructor(P, 0);
Q->n = (m1 * m1 - m2 * m2) / (ml2 - ml1);
+ if (Q->n == 0) {
+ // Not quite, but es is very close to 1...
+ return destructor(P, PJD_ERR_ECCENTRICITY_IS_ONE_OR_GREATER);
+ }
}
Q->ec = 1. - .5 * P->one_es * log((1. - P->e) /
(1. + P->e)) / P->e;