Skip to content

Commit 9052f4c

Browse files
authored
Merge pull request OSGeo#3838 from rouault/ossfuzz_fix
Ossfuzz fixes
2 parents 25f7722 + c8f28e4 commit 9052f4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/iso19111/operation/concatenatedoperation.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void ConcatenatedOperation::fixStepsDirection(
373373
auto derivedCRS = extractDerivedCRS(concatOpTargetCRS.get());
374374
if (derivedCRS) {
375375
if (i >= 1) {
376-
// use the sourceCRS of the previous operation as our source
376+
// use the targetCRS of the previous operation as our source
377377
// CRS
378378
l_sourceCRS = operationsInOut[i - 1]->targetCRS();
379379
// except if it looks like the previous operation should
@@ -385,7 +385,9 @@ void ConcatenatedOperation::fixStepsDirection(
385385
areCRSMoreOrLessEquivalent(
386386
operationsInOut[i - 1]->sourceCRS().get(),
387387
derivedCRS->baseCRS().get())) {
388-
l_targetCRS = operationsInOut[i - 1]->sourceCRS();
388+
l_sourceCRS = operationsInOut[i - 1]->sourceCRS();
389+
operationsInOut[i - 1] =
390+
operationsInOut[i - 1]->inverse();
389391
}
390392
}
391393
if (!l_sourceCRS) {

src/iso19111/operation/singleoperation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ CoordinateOperation::targetCoordinateEpoch() const {
218218

219219
void CoordinateOperation::setWeakSourceTargetCRS(
220220
std::weak_ptr<crs::CRS> sourceCRSIn, std::weak_ptr<crs::CRS> targetCRSIn) {
221-
d->sourceCRSWeak_ = sourceCRSIn;
222-
d->targetCRSWeak_ = targetCRSIn;
221+
d->sourceCRSWeak_ = std::move(sourceCRSIn);
222+
d->targetCRSWeak_ = std::move(targetCRSIn);
223223
}
224224

225225
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)