diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-04-22 18:01:09 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-04-22 18:01:09 +0200 |
| commit | 1b0c6fbc8b90522983b18772303ff517dec21cd5 (patch) | |
| tree | acf6efc5cb0a9714e0332335f4bbc5d957053aba /src/projections/airy.cpp | |
| parent | a73897b846cda97dfde9bd904d78b2049a6fb475 (diff) | |
| download | PROJ-1b0c6fbc8b90522983b18772303ff517dec21cd5.tar.gz PROJ-1b0c6fbc8b90522983b18772303ff517dec21cd5.zip | |
airy: avoid division by zero
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14410
Credit to OSS Fuzz
Diffstat (limited to 'src/projections/airy.cpp')
| -rw-r--r-- | src/projections/airy.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp index f7068061..ba6a40ff 100644 --- a/src/projections/airy.cpp +++ b/src/projections/airy.cpp @@ -79,6 +79,10 @@ static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */ } if (fabs(s = 1. - cosz) > EPS) { t = 0.5 * (1. + cosz); + if(t == 0) { + proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); + return xy; + } Krho = -log(t)/s - Q->Cb / t; } else Krho = 0.5 - Q->Cb; |
