소스 검색

Merge pull request #3376 from IvanSavenko/uninitialized_fixes

Fix uninitialized memory access
Ivan Savenko 1 년 전
부모
커밋
5fe5d81729
2개의 변경된 파일10개의 추가작업 그리고 7개의 파일을 삭제
  1. 9 7
      lib/LoadProgress.cpp
  2. 1 0
      lib/rewardable/Reward.cpp

+ 9 - 7
lib/LoadProgress.cpp

@@ -13,14 +13,16 @@
 
 using namespace Load;
 
-Progress::Progress(): _progress(std::numeric_limits<Type>::min())
+Progress::Progress()
+	: Progress(100)
+{}
+
+Progress::Progress(int steps)
+	: _progress(std::numeric_limits<Type>::min())
+	, _target(std::numeric_limits<Type>::max())
+	, _step(std::numeric_limits<Type>::min())
+	, _maxSteps(steps)
 {
-	setupSteps(100);
-}
-
-Progress::Progress(int steps): _progress(std::numeric_limits<Type>::min())
-{
-	setupSteps(steps);
 }
 
 Type Progress::get() const

+ 1 - 0
lib/rewardable/Reward.cpp

@@ -33,6 +33,7 @@ Rewardable::Reward::Reward()
 	, heroLevel(0)
 	, manaDiff(0)
 	, manaPercentage(-1)
+	, manaOverflowFactor(0)
 	, movePoints(0)
 	, movePercentage(-1)
 	, primary(4, 0)