From 44fc7dda9fc411f7c2f052c2271d563bc52f2518 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 15 Mar 2019 20:17:28 +0100 Subject: ellps_spherification(): detect invalid semi-major axis value Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12909 Credit to OSS Fuzz --- src/ell_set.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ell_set.cpp') diff --git a/src/ell_set.cpp b/src/ell_set.cpp index 71746895..386b4f46 100644 --- a/src/ell_set.cpp +++ b/src/ell_set.cpp @@ -399,6 +399,10 @@ static int ellps_spherification (PJ *P) { break; } + if (P->a <= 0.) { + return proj_errno_set(P, PJD_ERR_MAJOR_AXIS_NOT_GIVEN); + } + /* Clean up the ellipsoidal parameters to reflect the sphere */ P->es = P->e = P->f = 0; P->rf = HUGE_VAL; -- cgit v1.2.3