From 188165a06338a3b9998d0016454c79c04bdf9e86 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 14 Jan 2015 21:59:39 +0000 Subject: [PATCH] Fix stupid crash on fallback glyph handling (ttf branch) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 03c3cfcb6..caef89e94 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6550,7 +6550,8 @@ const ImFont::Glyph* ImFont::FindGlyph(unsigned short c) const if (c < (int)IndexLookup.size()) { const int i = IndexLookup[c]; - return &Glyphs[i]; + if (i != -1) + return &Glyphs[i]; } return FallbackGlyph; }