From 87352fdcb55489b0e143e035942222dcf058e6c0 Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Mon, 29 Jan 2018 07:44:54 -0800 Subject: [PATCH] stb_truetype: fix bug in handling of stbtt_hheap that could cause severe badness --- stb_truetype.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stb_truetype.h b/stb_truetype.h index 5eface5..98c8acc 100644 --- a/stb_truetype.h +++ b/stb_truetype.h @@ -43,7 +43,7 @@ // Hou Qiming Derek Vinyard // Rob Loach Cort Stratton // Kenney Phillis Jr. github:oyvindjam -// github:vassvik +// Brian Costabile github:vassvik // // VERSION HISTORY // @@ -2412,7 +2412,7 @@ static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) hh->num_remaining_in_head_chunk = count; } --hh->num_remaining_in_head_chunk; - return (char *) (hh->head) + size * hh->num_remaining_in_head_chunk; + return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk; } }