Skip to content

Commit 7c80355

Browse files
committed
ConcatenatedOperation::fixStepsDirection(): fix logic error (Coverity CID 416067)
1 parent 25367b6 commit 7c80355

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
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) {

0 commit comments

Comments
 (0)