diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-15 20:17:28 +0100 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2019-03-17 08:11:09 +0100 |
| commit | b146ce4dba788c6f7480a999f89e46eea4bdfbf4 (patch) | |
| tree | 7dde41029cd10ba2392e6283da5eca8581735e79 /src/ell_set.cpp | |
| parent | d6c8e820ec85b9474cd1e1fe166a7ccb752843be (diff) | |
| download | PROJ-b146ce4dba788c6f7480a999f89e46eea4bdfbf4.tar.gz PROJ-b146ce4dba788c6f7480a999f89e46eea4bdfbf4.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/ell_set.cpp')
| -rw-r--r-- | src/ell_set.cpp | 4 |
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; |
