summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-29 13:37:32 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-29 13:37:32 -0800
commit4e40872fc0ec5df8fd24e71e142f79ce5333307e (patch)
tree17acf0d4cc40408ed9f735d0288aa9912604ec48
parent962e71d495c5184cde7a33259ef945417334f0f0 (diff)
downloadsubsurface-4e40872fc0ec5df8fd24e71e142f79ce5333307e.tar.gz
Prevent potential access to uninitialized variable
If we have a dive with no data (e.g. from a failed import), we might never assign a value otherwise. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profile/diveprofileitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 81e91c771..3f64fd47a 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -572,7 +572,7 @@ DiveMeanDepthItem::DiveMeanDepthItem()
void DiveMeanDepthItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
- double meandepthvalue;
+ double meandepthvalue = 0.0;
// We don't have enougth data to calculate things, quit.
if (!shouldCalculateStuff(topLeft, bottomRight))
return;