summaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-04 17:14:22 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-04 17:14:22 -0800
commit798965c10ddb18de29646ec8d50bb9ac73e2f685 (patch)
tree364247e82bfc6e2ddd25053baee18eb6c732ba1d /qt-models/diveplannermodel.cpp
parentd36f056bded107ea78abb39b64b810a249d64966 (diff)
downloadsubsurface-798965c10ddb18de29646ec8d50bb9ac73e2f685.tar.gz
Initialize cylinder index
Otherwise it's possible for an uninitialized value to be used in addStop which can cause crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r--qt-models/diveplannermodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 4151e0c39..a937de9ac 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -94,7 +94,7 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
// average samples so we end up with a total of 100 samples.
int plansamples = dc->samples <= 100 ? dc->samples : 100;
int j = 0;
- int cylinderid;
+ int cylinderid = 0;
for (int i = 0; i < plansamples - 1; i++) {
while (j * plansamples <= i * dc->samples) {
const sample &s = dc->sample[j];