From bc53524cfbde95ecf6bb134984e68eb715d11c2b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 17 Sep 2019 21:48:46 +0200 Subject: ell_set.cpp: avoid division by zero in R_lat_a case. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16130 --- src/ell_set.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ell_set.cpp') diff --git a/src/ell_set.cpp b/src/ell_set.cpp index 0d7fb6d5..d2930ca4 100644 --- a/src/ell_set.cpp +++ b/src/ell_set.cpp @@ -389,6 +389,9 @@ static int ellps_spherification (PJ *P) { return proj_errno_set (P, PJD_ERR_REF_RAD_LARGER_THAN_90); t = sin (t); t = 1 - P->es * t * t; + if (t == 0.) { + return proj_errno_set(P, PJD_ERR_INVALID_ECCENTRICITY); + } if (i==5) /* arithmetic */ P->a *= (1. - P->es + t) / (2 * t * sqrt(t)); else /* geometric */ -- cgit v1.2.3