diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-02-03 12:23:50 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-02-03 12:23:50 +0100 |
| commit | b30ed5cba50688cea9ac2af90855177f84efea5a (patch) | |
| tree | 27ca2d29d8cef803a5659f61d3b0bb48a6771426 /src/projections/labrd.cpp | |
| parent | abad23412f0920276c32567c8f237be23aa94941 (diff) | |
| download | PROJ-b30ed5cba50688cea9ac2af90855177f84efea5a.tar.gz PROJ-b30ed5cba50688cea9ac2af90855177f84efea5a.zip | |
labrd: avoid floating point division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12849. Credit to OSS Fuzz
Diffstat (limited to 'src/projections/labrd.cpp')
| -rw-r--r-- | src/projections/labrd.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/labrd.cpp b/src/projections/labrd.cpp index 330c105f..85ab3ddd 100644 --- a/src/projections/labrd.cpp +++ b/src/projections/labrd.cpp @@ -108,6 +108,10 @@ PJ *PROJECTION(labrd) { return pj_default_destructor (P, ENOMEM); P->opaque = Q; + if (P->phi0 == 0.) { + return pj_default_destructor(P, PJD_ERR_LAT_0_IS_ZERO); + } + Az = pj_param(P->ctx, P->params, "razi").f; sinp = sin(P->phi0); t = 1. - P->es * sinp * sinp; |
