From 91d23e65ace9872a785f66db756d77e01381556f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 17 Sep 2019 19:53:13 +0200 Subject: eqdc: avoid potential division by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17190 --- src/projections/eqdc.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/projections/eqdc.cpp') 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; } -- cgit v1.2.3