diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-09-17 19:34:46 +0000 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-09-17 19:34:46 +0000 |
| commit | b66081ceef1481340017ba78fcf4b1dcc2176332 (patch) | |
| tree | 7422c70f882b8b686a42ec2167e30d884f9d205c /src/projections/aea.cpp | |
| parent | f38eb52f1fecaf5ec11ba4d9879c751bc21c55fa (diff) | |
| download | PROJ-b66081ceef1481340017ba78fcf4b1dcc2176332.tar.gz PROJ-b66081ceef1481340017ba78fcf4b1dcc2176332.zip | |
aea_e_inverse(): avoid calling asin() with invalid argument which results in NaN being propagated. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15336
Diffstat (limited to 'src/projections/aea.cpp')
| -rw-r--r-- | src/projections/aea.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp index 721ea3c9..d607c95a 100644 --- a/src/projections/aea.cpp +++ b/src/projections/aea.cpp @@ -127,6 +127,10 @@ static PJ_LP aea_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoid/spheroid, inverse if (Q->ellips) { lp.phi = (Q->c - lp.phi * lp.phi) / Q->n; if (fabs(Q->ec - fabs(lp.phi)) > TOL7) { + if (fabs(lp.phi) > 2 ) { + proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); + return lp; + } if ((lp.phi = phi1_(lp.phi, P->e, P->one_es)) == HUGE_VAL) { proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); return lp; |
