From 7c6fe559f00de0c2c65e6017aca2e73bb3c48cbb Mon Sep 17 00:00:00 2001 From: "Sean C. Rhea" Date: Mon, 29 Jan 2007 19:59:04 +0000 Subject: [PATCH] Fix for crash where ride time is shorter than smoothing. In particular, the sample ride is shorter than the default smoothing value. --- src/gui/AllPlot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/AllPlot.cpp b/src/gui/AllPlot.cpp index 7950cbe1c..c337ae03b 100644 --- a/src/gui/AllPlot.cpp +++ b/src/gui/AllPlot.cpp @@ -90,7 +90,8 @@ AllPlot::recalc() double *smoothSpeed = new double[rideTimeSecs + 1]; double *smoothCad = new double[rideTimeSecs + 1]; double *smoothTime = new double[rideTimeSecs + 1]; - for (int secs = 0; secs < smooth; ++secs) { + for (int secs = 0; ((secs < smooth) + && (secs < rideTimeSecs)); ++secs) { smoothWatts[secs] = 0.0; smoothHr[secs] = 0.0; smoothSpeed[secs] = 0.0;