mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-13 12:42:20 +00:00
Fix SEGV LTM Edit
.. when using Moving Average trend.
This commit is contained in:
@@ -755,6 +755,7 @@ LTMPlot::setData(LTMSettings *set)
|
||||
// we need to fill in the gaps sadly
|
||||
int lcount = xdata[count];
|
||||
|
||||
if (lcount) {
|
||||
// calculated values
|
||||
QVector<double> xtrend(lcount);
|
||||
QVector<double> btrend(lcount);
|
||||
@@ -767,7 +768,7 @@ LTMPlot::setData(LTMSettings *set)
|
||||
ytrend[0] = ydata[0];
|
||||
xtrend[0] = 0;
|
||||
|
||||
for (int n=1,i=1; i<= lcount; i++) {
|
||||
for (int n=1,i=1; i<= lcount && i<xdata.size(); i++) {
|
||||
|
||||
// fill in gaps (and check bounds as we go too)
|
||||
while (n<=xdata[i] && n<lcount) {
|
||||
@@ -787,6 +788,7 @@ LTMPlot::setData(LTMSettings *set)
|
||||
curves.insert(trendSymbol, trend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// highlight outliers
|
||||
if (metricDetail.topOut > 0 && metricDetail.topOut < count && count > 10) {
|
||||
@@ -1860,6 +1862,7 @@ LTMPlot::setCompareData(LTMSettings *set)
|
||||
// we need to fill in the gaps sadly
|
||||
int lcount = xdata[count];
|
||||
|
||||
if (lcount) {
|
||||
// calculated values
|
||||
QVector<double> xtrend(lcount);
|
||||
QVector<double> btrend(lcount);
|
||||
@@ -1872,7 +1875,7 @@ LTMPlot::setCompareData(LTMSettings *set)
|
||||
ytrend[0] = ydata[0];
|
||||
xtrend[0] = 0;
|
||||
|
||||
for (int n=1,i=1; i<= lcount; i++) {
|
||||
for (int n=1,i=1; i<= lcount && i<xdata.size(); i++) {
|
||||
|
||||
// fill in gaps (and check bounds as we go too)
|
||||
while (n<=xdata[i] && n<lcount) {
|
||||
@@ -1892,6 +1895,7 @@ LTMPlot::setCompareData(LTMSettings *set)
|
||||
curves.insert(trendSymbol, trend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// highlight outliers
|
||||
if (metricDetail.topOut > 0 && metricDetail.topOut < count && count > 10) {
|
||||
|
||||
Reference in New Issue
Block a user