Explorar o código

uninitialized variables-util

AzaezelX %!s(int64=5) %!d(string=hai) anos
pai
achega
43259e29c1
Modificáronse 2 ficheiros con 4 adicións e 2 borrados
  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 )
       {