diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-03-04 17:14:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-03-04 17:14:22 -0800 |
commit | 798965c10ddb18de29646ec8d50bb9ac73e2f685 (patch) | |
tree | 364247e82bfc6e2ddd25053baee18eb6c732ba1d /qt-models | |
parent | d36f056bded107ea78abb39b64b810a249d64966 (diff) | |
download | subsurface-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')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 2 |
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]; |