aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;