diff options
| author | Even Rouault <even.rouault@mines-paris.org> | 2019-04-05 15:41:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-05 15:41:28 +0200 |
| commit | 0ea2b4e82700ba9aa0ae67ec0ee72ae58bc4f0c9 (patch) | |
| tree | a602774d5e52071f006b37d59147708a4b57739e /src/projections/imw_p.cpp | |
| parent | 1e2e512f9a671df504f6f01eee53dc26939b3c0a (diff) | |
| parent | f6ba932a8f1d7f0775d4ebe367b2d5faef57461a (diff) | |
| download | PROJ-0ea2b4e82700ba9aa0ae67ec0ee72ae58bc4f0c9.tar.gz PROJ-0ea2b4e82700ba9aa0ae67ec0ee72ae58bc4f0c9.zip | |
Merge pull request #1411 from rouault/ossfuzz_14044_and_all
Ossfuzz 14044 and others
Diffstat (limited to 'src/projections/imw_p.cpp')
| -rw-r--r-- | src/projections/imw_p.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/projections/imw_p.cpp b/src/projections/imw_p.cpp index 41882df2..8d675318 100644 --- a/src/projections/imw_p.cpp +++ b/src/projections/imw_p.cpp @@ -117,12 +117,16 @@ static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */ do { t = loc_for(lp, P, &yc); const double denom = t.y - yc; - if( denom == 0 ) { - proj_errno_set(P, PJD_ERR_NON_CONVERGENT); - return proj_coord_error().lp; + if( denom != 0 || fabs(t.y - xy.y) > TOL ) + { + if( denom == 0 ) { + proj_errno_set(P, PJD_ERR_NON_CONVERGENT); + return proj_coord_error().lp; + } + lp.phi = ((lp.phi - Q->phi_1) * (xy.y - yc) / denom) + Q->phi_1; } - lp.phi = ((lp.phi - Q->phi_1) * (xy.y - yc) / denom) + Q->phi_1; - lp.lam = lp.lam * xy.x / t.x; + if( t.x != 0 || fabs(t.x - xy.x) > TOL ) + lp.lam = lp.lam * xy.x / t.x; i ++; } while (i < N_MAX_ITER && (fabs(t.x - xy.x) > TOL || fabs(t.y - xy.y) > TOL)); |
