From 816e58db8a37985de547f4a376db8752df412c94 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Tue, 20 Oct 2015 15:27:22 +0100 Subject: [PATCH] Fix 'Fix Elevation' SEGV .. there may be more bugs lurking in there but this resolves a SEGV that seems quite common. --- src/FixElevation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FixElevation.cpp b/src/FixElevation.cpp index 0e4a1dc57..ff5c0a6cd 100644 --- a/src/FixElevation.cpp +++ b/src/FixElevation.cpp @@ -176,7 +176,7 @@ FixElevation::postProcess(RideFile *ride, DataProcessorConfig *) int loopCount = 0; for( std::vector::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;