Skip to content

Commit

Permalink
stb_truetype: fix bug in handling of stbtt_hheap that could cause sev…
Browse files Browse the repository at this point in the history
…ere badness
  • Loading branch information
Sean Barrett committed Jan 29, 2018
1 parent db4d928 commit 87352fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stb_truetype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 87352fd

Please sign in to comment.