From 64679a0b03126bf6cd1a9cf400b179bf8f5818cf Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 29 Jan 2015 17:44:46 +0100 Subject: [PATCH] ImFontAtlas::Build() does a sanity memset on glyph rectangles. --- imgui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.cpp b/imgui.cpp index a8b8d4b9..f3b23c43 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6602,6 +6602,7 @@ bool ImFontAtlas::Build() stbrp_rect* buf_rects = (stbrp_rect*)ImGui::MemAlloc(total_glyph_count * sizeof(stbrp_rect)); stbtt_pack_range* buf_ranges = (stbtt_pack_range*)ImGui::MemAlloc(total_glyph_range_count * sizeof(stbtt_pack_range)); memset(buf_packedchars, 0, total_glyph_count * sizeof(stbtt_packedchar)); + memset(buf_rects, 0, total_glyph_count * sizeof(stbrp_rect)); // Unnessary but let's clear this for the sake of sanity. memset(buf_ranges, 0, total_glyph_range_count * sizeof(stbtt_pack_range)); // First pass: pack all glyphs (no rendering at this point, we are working with glyph sizes only)