diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-10-10 20:43:31 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-10-10 20:43:31 +0200 |
| commit | 7f0b6bd9c6978ac7639bcaf0de452cb29318e683 (patch) | |
| tree | 8545fa5fdd3f41aee6931d7346771e3db9bd7b8b /src/iso19111 | |
| parent | fdaf93449faebc80b53b09208f9766bca68a084b (diff) | |
| download | PROJ-7f0b6bd9c6978ac7639bcaf0de452cb29318e683.tar.gz PROJ-7f0b6bd9c6978ac7639bcaf0de452cb29318e683.zip | |
proj_crs_get_datum_forced(): catch potential exception (fixes CID 358433, 358434, 358435)
Diffstat (limited to 'src/iso19111')
| -rw-r--r-- | src/iso19111/c_api.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index 9493452c..acf36402 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -8479,7 +8479,12 @@ PJ *proj_crs_get_datum_forced(PJ_CONTEXT *ctx, const PJ *crs) { const auto &datumEnsemble = l_crs->datumEnsemble(); assert(datumEnsemble); auto dbContext = getDBcontextNoException(ctx, __FUNCTION__); - return pj_obj_create(ctx, datumEnsemble->asDatum(dbContext)); + try { + return pj_obj_create(ctx, datumEnsemble->asDatum(dbContext)); + } catch (const std::exception &e) { + proj_log_debug(ctx, __FUNCTION__, e.what()); + return nullptr; + } } // --------------------------------------------------------------------------- |
