aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-03-15 20:17:28 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-03-16 10:10:02 +0100
commit44fc7dda9fc411f7c2f052c2271d563bc52f2518 (patch)
treecdfa331dd0c2383a891b2c845bfc81344614c651 /src
parent7dd1a2ee6bfb33807594f115c59548f8cf1d3475 (diff)
downloadPROJ-44fc7dda9fc411f7c2f052c2271d563bc52f2518.tar.gz
PROJ-44fc7dda9fc411f7c2f052c2271d563bc52f2518.zip
ellps_spherification(): detect invalid semi-major axis value
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12909 Credit to OSS Fuzz
Diffstat (limited to 'src')
-rw-r--r--src/ell_set.cpp4
1 files changed, 4 insertions, 0 deletions
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;