Skip to content

Commit fd283da

Browse files
Merge pull request #2103 from SFN-eu/dev/fix-misc-memory-issues
Miscellaneous memory correctness improvements
2 parents a9d7da7 + e423969 commit fd283da

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

src/aliceVision/camera/IntrinsicBase.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,18 @@ class IntrinsicBase
471471
void setState(EEstimatorParameterState state) { _state = state; }
472472

473473
protected:
474+
std::string _serialNumber;
475+
double _sensorWidth = 36.0;
476+
double _sensorHeight = 24.0;
477+
unsigned int _w = 0;
478+
unsigned int _h = 0;
479+
474480
/// initialization mode
475481
EInitMode _initializationMode = EInitMode::NONE;
482+
476483
/// intrinsic lock
477484
bool _locked = false;
478485
EEstimatorParameterState _state = EEstimatorParameterState::REFINED;
479-
480-
unsigned int _w = 0;
481-
unsigned int _h = 0;
482-
double _sensorWidth = 36.0;
483-
double _sensorHeight = 24.0;
484-
std::string _serialNumber;
485486
};
486487

487488
/**

src/aliceVision/camera/IntrinsicScaleOffset.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ class IntrinsicScaleOffset : public IntrinsicBase
158158
void setInitialFocalLength(double initialFocalLengthMM, double pixelAspectRatio, bool useCompatibility = false);
159159

160160
protected:
161-
Vec2 _scale{1.0, 1.0};
162-
Vec2 _offset{0.0, 0.0};
163-
Vec2 _initialScale{-1.0, -1.0};
164161
bool _ratioLocked{true};
165162
bool _offsetLocked{false};
166163
bool _scaleLocked{false};
164+
Vec2 _scale{1.0, 1.0};
165+
Vec2 _offset{0.0, 0.0};
166+
Vec2 _initialScale{-1.0, -1.0};
167167
};
168168

169169
} // namespace camera

src/aliceVision/mvsUtils/MultiViewParams.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ std::vector<int> MultiViewParams::findTileNearestCams(int rc, int nbNearestCams,
656656
ids.push_back(SortedId(tcScorePair.first, tcScorePair.second));
657657
}
658658

659+
if(ids.empty())
660+
return out;
661+
659662
qsort(&ids[0], ids.size(), sizeof(SortedId), qsortCompareSortedIdDesc);
660663

661664
// ensure the ideal number of target cameras is not superior to the actual number of cameras

0 commit comments

Comments
 (0)