aboutsummaryrefslogtreecommitdiff
path: root/src/projections
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2019-04-22 20:31:50 +0200
committerGitHub <noreply@github.com>2019-04-22 20:31:50 +0200
commit28cdae60149de8b38f7e10072326bb714b79ef0a (patch)
treee5852e807696d04ecf67e20ef39984c119197415 /src/projections
parent1ebec58e22cce57310f40fa5a455b0b89c7f19b6 (diff)
parent1b0c6fbc8b90522983b18772303ff517dec21cd5 (diff)
downloadPROJ-28cdae60149de8b38f7e10072326bb714b79ef0a.tar.gz
PROJ-28cdae60149de8b38f7e10072326bb714b79ef0a.zip
Merge pull request #1440 from rouault/ossfuzz_14410
airy: avoid division by zero
Diffstat (limited to 'src/projections')
-rw-r--r--src/projections/airy.cpp4
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;