mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Fix Bounds checking SEGV
RideFileCache hogs CPU / hangs with poorly parsed files, whilst the activity may crash when columns are removed.
This commit is contained in:
@@ -579,6 +579,10 @@ MeanMaxComputer::run()
|
||||
|
||||
// fill in any gaps in recording - use same dodgy rounding as before
|
||||
int count = (psecs - lastsecs - ride->recIntSecs()) / ride->recIntSecs();
|
||||
|
||||
// gap more than an hour, damn that ride file is a mess
|
||||
if (count > 3600) count = 1;
|
||||
|
||||
for(int i=0; i<count; i++)
|
||||
data.points.append(cpintpoint(round(lastsecs+((i+1)*ride->recIntSecs() *1000.0)/1000), 0));
|
||||
lastsecs = psecs;
|
||||
@@ -597,6 +601,9 @@ MeanMaxComputer::run()
|
||||
// than 2 days, even if you are doing RAAM
|
||||
if (total_secs > 2*24*60*60) return;
|
||||
|
||||
// don't allow if badly parsed or time goes backwards
|
||||
if (total_secs < 0) return;
|
||||
|
||||
//
|
||||
// Pre-process the data for NP, xPower and VAM
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user