From 8513b632a27ff2204e021a080c9ed3879b8268d8 Mon Sep 17 00:00:00 2001 From: Ron Aaron Date: Fri, 6 Mar 2020 13:05:56 +0200 Subject: [PATCH] really fixed memory issue, bumped version, remove tabs --- nuklear.h | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nuklear.h b/nuklear.h index 23299ed..5a9dca2 100644 --- a/nuklear.h +++ b/nuklear.h @@ -16343,7 +16343,7 @@ nk_font_baker_memory(nk_size *temp, int *glyph_count, } while ((i = i->n) != iter); } *temp = (nk_size)*glyph_count * sizeof(struct stbrp_rect); - *temp += (nk_size)*glyph_count * sizeof(stbtt_pack_range); + *temp += (nk_size)total_range_count * sizeof(stbtt_pack_range); *temp += (nk_size)*glyph_count * sizeof(stbtt_packedchar); *temp += (nk_size)count * sizeof(struct nk_font_bake_data); *temp += sizeof(struct nk_font_baker); @@ -17384,6 +17384,7 @@ nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height, tmp = atlas->temporary.alloc(atlas->temporary.userdata,0, tmp_size); NK_ASSERT(tmp); if (!tmp) goto failed; + memset(tmp,0,tmp_size); /* allocate glyph memory for all fonts */ baker = nk_font_baker(tmp, atlas->glyph_count, atlas->font_num, &atlas->temporary); diff --git a/package.json b/package.json index 27d6987..d350fa4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.01.5", + "version": "4.01.6", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"],