From 70ed3efe60718be74d73d92ec2d121e2de268e53 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 4 Apr 2019 22:36:00 +0200 Subject: Reject negative e parameter to avoid division by zero Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14044 Credit to OSS Fuzz --- src/projections/aea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/projections/aea.cpp') diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp index 8a80c49c..e488ddd9 100644 --- a/src/projections/aea.cpp +++ b/src/projections/aea.cpp @@ -182,7 +182,7 @@ static PJ *setup(PJ *P) { 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); + return destructor(P, PJD_ERR_INVALID_ECCENTRICITY); } } Q->ec = 1. - .5 * P->one_es * log((1. - P->e) / -- cgit v1.2.3