summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-11-30 09:18:01 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-30 09:24:59 -0800
commit58d37e02001d7f54baf35b72dd1323b8886153d9 (patch)
treeb6981dc7a391413d8d03f04744ed17f9c0857699
parent22e0323d6ad28933644cd98743d693c5f23f71a5 (diff)
downloadsubsurface-58d37e02001d7f54baf35b72dd1323b8886153d9.tar.gz
Fix uninitialised variable read
Found by Dr. Memory, run by Lubomir: Error #48: UNINITIALIZED READ: reading register al # 0 StarWidget::mouseReleaseEvent() [qt-ui/starwidget.cpp:29] Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/starwidget.cpp3
-rw-r--r--qt-ui/starwidget.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/starwidget.cpp b/qt-ui/starwidget.cpp
index 30c38808c..12b400124 100644
--- a/qt-ui/starwidget.cpp
+++ b/qt-ui/starwidget.cpp
@@ -63,7 +63,8 @@ void StarWidget::setCurrentStars(int value)
StarWidget::StarWidget(QWidget* parent, Qt::WindowFlags f):
QWidget(parent, f),
- current(0)
+ current(0),
+ readOnly(false)
{
if (!activeStar) {
activeStar = new QPixmap();
diff --git a/qt-ui/starwidget.h b/qt-ui/starwidget.h
index 10a8a3073..9620bc62e 100644
--- a/qt-ui/starwidget.h
+++ b/qt-ui/starwidget.h
@@ -30,10 +30,11 @@ protected:
private:
int current;
+ bool readOnly;
+
static QPixmap* activeStar;
static QPixmap* inactiveStar;
QPixmap grayImage(QPixmap *coloredImg);
- bool readOnly;
};
#endif // STARWIDGET_H