From 26dd86f5a635b8aaa827c969184345970ef6c04f Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 25 Oct 2016 16:05:05 +0200 Subject: [PATCH] Changed: Properly initialize all members of SLetterInfo and SLetterKey to avoid crashes when accessing to them --- code/nel/include/nel/3d/texture_font.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/nel/include/nel/3d/texture_font.h b/code/nel/include/nel/3d/texture_font.h index 3aeb77b65..20353f236 100644 --- a/code/nel/include/nel/3d/texture_font.h +++ b/code/nel/include/nel/3d/texture_font.h @@ -61,6 +61,10 @@ public: sint32 Top; // Distance between origin and top of the texture sint32 Left; // Distance between origin and left of the texture sint32 AdvX; // Advance to the next caracter + + SLetterInfo():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false), Next(NULL), Prev(NULL), Cat(0), CharWidth(0), CharHeight(0), GlyphIndex(0), Top(0), Left(0), AdvX(0) + { + } }; struct SLetterKey @@ -74,6 +78,10 @@ public: uint32 getVal(); //bool operator < (const SLetterKey&k) const; //bool operator == (const SLetterKey&k) const; + + SLetterKey():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false) + { + } }; public: