[PATCH 1/4] Fix uninitialised variable read

Thiago Macieira thiago at macieira.org
Sat Nov 30 09:18:01 UTC 2013


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 at macieira.org>
---
 qt-ui/starwidget.cpp | 3 ++-
 qt-ui/starwidget.h   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/qt-ui/starwidget.cpp b/qt-ui/starwidget.cpp
index 30c3880..12b4001 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 10a8a30..9620bc6 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
-- 
1.7.11.7



More information about the subsurface mailing list