From 1eef869669b671209e1913246f7e2f1d81277bb4 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 13 Feb 2015 08:56:06 +0000 Subject: [PATCH] Fix ImFont::BuildLookupTable() potential dangling pointer dereference (fix #131) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index feb3b5992..c32deddb3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7379,7 +7379,7 @@ void ImFont::BuildLookupTable() { Glyphs.resize(Glyphs.size() + 1); ImFont::Glyph& tab_glyph = Glyphs.back(); - tab_glyph = *space_glyph; + tab_glyph = *FindGlyph((unsigned short)' '); tab_glyph.Codepoint = '\t'; tab_glyph.XAdvance *= 4; IndexXAdvance[(size_t)tab_glyph.Codepoint] = (float)tab_glyph.XAdvance;