Fix 'Fix Elevation' SEGV

.. there may be more bugs lurking in there but this resolves
   a SEGV that seems quite common.
This commit is contained in:
Mark Liversedge
2015-10-20 15:27:22 +01:00
parent 5503d6dcf8
commit 635fcf220b

View File

@@ -176,7 +176,7 @@ FixElevation::postProcess(RideFile *ride, DataProcessorConfig *)
int loopCount = 0;
for( std::vector<elevationGPSPoint>::iterator point = elvPoints.begin() ; point != elvPoints.end() ; ++point ) {
double elev = smoothArray[loopCount];
double elev = smoothArray.size() > loopCount ? smoothArray[loopCount] : -100;
// ignore any seriously negative points
if (elev>-100) ride->command->setPointValue(point->rideFileIndex, RideFile::alt, elev);
++loopCount;