diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-11-12 23:42:09 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-11-12 23:42:09 +0100 |
| commit | 5939b96213305295edd010892220919f8f2fd1cf (patch) | |
| tree | 13215b3c577748b92b3663b3706542aa908ffb2d /src | |
| parent | ac882266b57d04720bb645b8144901127f7427cf (diff) | |
| download | PROJ-5939b96213305295edd010892220919f8f2fd1cf.tar.gz PROJ-5939b96213305295edd010892220919f8f2fd1cf.zip | |
createOperationsCompoundToCompound(): fix null pointer dereference when connection to proj.db doesn't exist. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40955
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/operation/coordinateoperationfactory.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp index e9bd3cfe..9b891888 100644 --- a/src/iso19111/operation/coordinateoperationfactory.cpp +++ b/src/iso19111/operation/coordinateoperationfactory.cpp @@ -5250,8 +5250,10 @@ void CoordinateOperationFactory::Private::createOperationsCompoundToCompound( // and a geoid model for Belfast height referenced to ETRS89 if (verticalTransforms.size() == 1 && verticalTransforms.front()->hasBallparkTransformation()) { - auto dbContext = - context.context->getAuthorityFactory()->databaseContext(); + const auto &authFactory = context.context->getAuthorityFactory(); + auto dbContext = authFactory + ? authFactory->databaseContext().as_nullable() + : nullptr; const auto intermGeogSrc = srcGeog->promoteTo3D(std::string(), dbContext); const bool intermGeogSrcIsSameAsIntermGeogDst = |
