From 1b0c6fbc8b90522983b18772303ff517dec21cd5 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 22 Apr 2019 18:01:09 +0200 Subject: airy: avoid division by zero Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14410 Credit to OSS Fuzz --- src/projections/airy.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/projections/airy.cpp') 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; -- cgit v1.2.3