diff options
| author | Even Rouault <even.rouault@mines-paris.org> | 2019-03-27 11:51:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-27 11:51:48 +0100 |
| commit | a268bf4e7e521e95e326099aee201aa0689a8f9f (patch) | |
| tree | 8b031345b9c28c5568778c75bc26378a31aa5454 /src/projections/misrsom.cpp | |
| parent | c5772cf1b7cb0f467d12f7f8b99516cc8b3a98c5 (diff) | |
| parent | 3e85ebc697ccfc439a2b80488a5056e576c1acea (diff) | |
| download | PROJ-a268bf4e7e521e95e326099aee201aa0689a8f9f.tar.gz PROJ-a268bf4e7e521e95e326099aee201aa0689a8f9f.zip | |
Merge pull request #1378 from OSGeo/backport-1376-on-6.0
Backport #1376 on 6.0: Ossfuzz 13894 follow up
Diffstat (limited to 'src/projections/misrsom.cpp')
| -rw-r--r-- | src/projections/misrsom.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/projections/misrsom.cpp b/src/projections/misrsom.cpp index c53f22a1..d16dd62d 100644 --- a/src/projections/misrsom.cpp +++ b/src/projections/misrsom.cpp @@ -151,10 +151,14 @@ static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */ lamdp -= TOL; spp = sin(phidp); sppsq = spp * spp; + const double denom = 1. - sppsq * (1. + Q->u); + if( denom == 0.0 ) { + proj_errno_set(P, PJD_ERR_NON_CONVERGENT); + return proj_coord_error().lp; + } lamt = atan(((1. - sppsq * P->rone_es) * tan(lamdp) * Q->ca - spp * Q->sa * sqrt((1. + Q->q * dd) * ( - 1. - sppsq) - sppsq * Q->u) / cos(lamdp)) / (1. - sppsq - * (1. + Q->u))); + 1. - sppsq) - sppsq * Q->u) / cos(lamdp)) / denom); sl = lamt >= 0. ? 1. : -1.; scl = cos(lamdp) >= 0. ? 1. : -1; lamt -= M_HALFPI * (1. - scl) * sl; |
