aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-04-17 20:37:05 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-04-17 20:37:05 +0200
commitb7f5e7ea751588914eec2b64fd2ee39ac2eefc54 (patch)
tree826fcad63ffb109fc606b914be6ac8dbf96a6fbe
parent7920a3fed18d67262003d19131f2adf2e4aa4fb2 (diff)
downloadPROJ-b7f5e7ea751588914eec2b64fd2ee39ac2eefc54.tar.gz
PROJ-b7f5e7ea751588914eec2b64fd2ee39ac2eefc54.zip
ellps_shape: catch corner case where es would be set to NaN. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21761
-rw-r--r--src/ell_set.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ell_set.cpp b/src/ell_set.cpp
index 899ec1bf..434ae76d 100644
--- a/src/ell_set.cpp
+++ b/src/ell_set.cpp
@@ -318,7 +318,8 @@ static int ellps_shape (PJ *P) {
}
- if (P->es < 0)
+ // Written that way to catch NaN
+ if (!(P->es >= 0))
return proj_errno_set (P, PJD_ERR_ES_LESS_THAN_ZERO);
return 0;
}