diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-02-09 03:47:13 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-02-09 03:47:13 +0100 |
| commit | 1c3678b636ecc4860a24a137886de88f2813808c (patch) | |
| tree | 5c7a379f34cd407c4e72a9dab1e949d8ca65e103 /src/grids.cpp | |
| parent | 06d0a4c835ac2467d04879b8743b8bd2acdcdbad (diff) | |
| download | PROJ-1c3678b636ecc4860a24a137886de88f2813808c.tar.gz PROJ-1c3678b636ecc4860a24a137886de88f2813808c.zip | |
read_vgrid_value(): avoid assertion on huge latitude. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20592. master only
Diffstat (limited to 'src/grids.cpp')
| -rw-r--r-- | src/grids.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/grids.cpp b/src/grids.cpp index b641f088..ec447a33 100644 --- a/src/grids.cpp +++ b/src/grids.cpp @@ -3137,6 +3137,9 @@ static double read_vgrid_value(PJ_CONTEXT *ctx, const ListOfVGrids &grids, pj_ctx_set_errno(ctx, PJD_ERR_GRID_AREA); return HUGE_VAL; } + if (grid->isNullGrid()) { + return 0; + } const auto &extent = grid->extentAndRes(); @@ -3336,6 +3339,12 @@ bool pj_bilinear_interpolation_three_samples(const GenericShiftGrid *grid, double &v2, double &v3, bool &must_retry) { must_retry = false; + if (grid->isNullGrid()) { + v1 = 0.0; + v2 = 0.0; + v3 = 0.0; + return true; + } const auto &extent = grid->extentAndRes(); double grid_x = (lp.lam - extent.westLon) / extent.resLon; |
