diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-04-04 22:36:00 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-04-04 22:36:00 +0200 |
| commit | 70ed3efe60718be74d73d92ec2d121e2de268e53 (patch) | |
| tree | 2a16573f690d8f7e07df4dbbc0ab5fabd376723c /src/projections | |
| parent | 1e2e512f9a671df504f6f01eee53dc26939b3c0a (diff) | |
| download | PROJ-70ed3efe60718be74d73d92ec2d121e2de268e53.tar.gz PROJ-70ed3efe60718be74d73d92ec2d121e2de268e53.zip | |
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
Diffstat (limited to 'src/projections')
| -rw-r--r-- | src/projections/aea.cpp | 2 | ||||
| -rw-r--r-- | src/projections/lcc.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
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) / diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp index 55d28b80..3e93f98c 100644 --- a/src/projections/lcc.cpp +++ b/src/projections/lcc.cpp @@ -113,7 +113,7 @@ PJ *PROJECTION(lcc) { Q->n = log(m1 / pj_msfn(sinphi, cos(Q->phi2), P->es)); if (Q->n == 0) { // Not quite, but es is very close to 1... - return pj_default_destructor(P, PJD_ERR_ECCENTRICITY_IS_ONE_OR_GREATER); + return pj_default_destructor(P, PJD_ERR_INVALID_ECCENTRICITY); } const double ml2 = pj_tsfn(Q->phi2, sinphi, P->e); if( ml2 == 0 ) { |
