aboutsummaryrefslogtreecommitdiff
path: root/src/projections/eqdc.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-09-17 19:53:13 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-09-17 19:53:13 +0200
commit91d23e65ace9872a785f66db756d77e01381556f (patch)
treea1f062c4c326db4ced6ffb54102c60c6cd410824 /src/projections/eqdc.cpp
parentd2f661fc99615a33d72bb0120a14bca2aaced221 (diff)
downloadPROJ-91d23e65ace9872a785f66db756d77e01381556f.tar.gz
PROJ-91d23e65ace9872a785f66db756d77e01381556f.zip
eqdc: avoid potential division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17190
Diffstat (limited to 'src/projections/eqdc.cpp')
-rw-r--r--src/projections/eqdc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/projections/eqdc.cpp b/src/projections/eqdc.cpp
index e050a593..00aacfda 100644
--- a/src/projections/eqdc.cpp
+++ b/src/projections/eqdc.cpp
@@ -117,6 +117,8 @@ PJ *PROJECTION(eqdc) {
} else {
if (secant)
Q->n = (cosphi - cos(Q->phi2)) / (Q->phi2 - Q->phi1);
+ if (Q->n == 0)
+ return destructor (P, PJD_ERR_CONIC_LAT_EQUAL);
Q->c = Q->phi1 + cos(Q->phi1) / Q->n;
Q->rho0 = Q->c - P->phi0;
}