aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-08 12:00:51 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-08 12:00:51 +0100
commitda93fe3bea35ae8d2383e6006b7775bb96af6885 (patch)
tree0cf7a6ae07fcbe74f116cbde40db8cd94f42f16c /src
parentdd9afa39d785b6fcfbcdb5492bb4f3b448b8a183 (diff)
downloadPROJ-da93fe3bea35ae8d2383e6006b7775bb96af6885.tar.gz
PROJ-da93fe3bea35ae8d2383e6006b7775bb96af6885.zip
NTv2GridSet::open(): reject files with GS_TYPE!=SECONDS (fixes #1294)
Diffstat (limited to 'src')
-rw-r--r--src/grids.cpp5
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) {