diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-08 12:00:51 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-08 12:00:51 +0100 |
| commit | da93fe3bea35ae8d2383e6006b7775bb96af6885 (patch) | |
| tree | 0cf7a6ae07fcbe74f116cbde40db8cd94f42f16c /src/grids.cpp | |
| parent | dd9afa39d785b6fcfbcdb5492bb4f3b448b8a183 (diff) | |
| download | PROJ-da93fe3bea35ae8d2383e6006b7775bb96af6885.tar.gz PROJ-da93fe3bea35ae8d2383e6006b7775bb96af6885.zip | |
NTv2GridSet::open(): reject files with GS_TYPE!=SECONDS (fixes #1294)
Diffstat (limited to 'src/grids.cpp')
| -rw-r--r-- | src/grids.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/grids.cpp b/src/grids.cpp index edde66ba..3007fedc 100644 --- a/src/grids.cpp +++ b/src/grids.cpp @@ -1840,6 +1840,11 @@ std::unique_ptr<NTv2GridSet> NTv2GridSet::open(PJ_CONTEXT *ctx, pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); return nullptr; } + if (memcmp(header + 56, "SECONDS", 7) != 0) { + pj_log(ctx, PJ_LOG_ERROR, "Only GS_TYPE=SECONDS is supported"); + pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + return nullptr; + } const bool must_swap = (header[8] == 11) ? !IS_LSB : IS_LSB; if (must_swap) { |
