Browse Source

uninitialized variables-util

AzaezelX 5 years ago
parent
commit
43259e29c1
2 changed files with 4 additions and 2 deletions
  1. 2 0
      Engine/source/util/noise2d.cpp
  2. 2 2
      Engine/source/util/sampler.cpp

+ 2 - 0
Engine/source/util/noise2d.cpp

@@ -26,6 +26,8 @@
 //--------------------------------------
 Noise2D::Noise2D()
 {
+   dMemset(mPermutation, 0, sizeof(mPermutation));
+   dMemset(mGradient, 0, sizeof(mGradient));
    mSeed   = 0;
 }
 

+ 2 - 2
Engine/source/util/sampler.cpp

@@ -118,9 +118,9 @@ class CSVSamplerBackend : public ISamplerBackend
          const char*	mString;
       } mValue;
 
-      SampleRecord() {}
+      SampleRecord() : mKey(0), mSet(false), mType(TypeBool) { mValue.mBool = false; }
       SampleRecord( U32 key )
-         : mKey( key ), mSet( false ) {}
+         : mKey( key ), mSet( false ), mType(TypeBool) { mValue.mBool = false; }
 
       void set( bool value )
       {