From b7f5e7ea751588914eec2b64fd2ee39ac2eefc54 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 17 Apr 2020 20:37:05 +0200 Subject: ellps_shape: catch corner case where es would be set to NaN. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21761 --- src/ell_set.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ell_set.cpp') 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; } -- cgit v1.2.3