Browse Source

Fix uninitialized read of Texture::_format

Discovered by valgrind.
Call sequence leading to the problem:
Urho3D::FontFace::LoadFaceTexture calls CreateFaceTexture() and right afterwards SetData()
SetData will call IsCompressed() at line 316, thus reading potentially garbage data.
Artur K. 11 years ago
parent
commit
62fbdeee59
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Source/Engine/Graphics/OpenGL/OGLTexture.cpp

+ 1 - 0
Source/Engine/Graphics/OpenGL/OGLTexture.cpp

@@ -72,6 +72,7 @@ Texture::Texture(Context* context) :
     Resource(context),
     Resource(context),
     GPUObject(GetSubsystem<Graphics>()),
     GPUObject(GetSubsystem<Graphics>()),
     usage_(TEXTURE_STATIC),
     usage_(TEXTURE_STATIC),
+    format_(0),
     levels_(0),
     levels_(0),
     requestedLevels_(0),
     requestedLevels_(0),
     width_(0),
     width_(0),