diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-06-09 17:24:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-06-09 17:24:20 +0200 |
| commit | 144a611f844450f5ce4528772136f985c92406fe (patch) | |
| tree | 1a16ab9b05232111645336536e3b4a0c10e03bcb /src | |
| parent | dfa281a25d1f0fc5f3d919aa84f16b3b582a3f27 (diff) | |
| download | PROJ-144a611f844450f5ce4528772136f985c92406fe.tar.gz PROJ-144a611f844450f5ce4528772136f985c92406fe.zip | |
Conversion::_exportToPROJString(): avoid potential floating point div by zero. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23239
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index ecc3df06..63363ff2 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -6259,9 +6259,11 @@ void Conversion::_exportToPROJString( common::UnitOfMeasure::Type::LINEAR) .exportToPROJString(); auto reverse_uom = - common::UnitOfMeasure(std::string(), 1.0 / convFactor, - common::UnitOfMeasure::Type::LINEAR) - .exportToPROJString(); + convFactor == 0.0 + ? std::string() + : common::UnitOfMeasure(std::string(), 1.0 / convFactor, + common::UnitOfMeasure::Type::LINEAR) + .exportToPROJString(); if (uom == "m") { // do nothing } else if (!uom.empty()) { |
