fixed #395 heap corruption in nk_buffer

This commit is contained in:
vurtun 2017-04-09 15:49:58 +02:00
parent 7d5648db30
commit 89e6ed6b5a
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@
Changes:
--------
- 2017/04/09 (1.35.3) - Fixed buffer heap corruption
- 2017/03/25 (1.35.2) - Fixed popup overlapping for `NK_WINDOW_BACKGROUND` windows
- 2017/03/25 (1.35.1) - Fixed windows closing behavior
- 2017/03/18 (1.35.0) - Added horizontal scroll requested in #377

View File

@ -5468,7 +5468,7 @@ nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
/* check if buffer has enough memory*/
if (type == NK_BUFFER_FRONT)
full = ((b->allocated + size + alignment) > b->size);
else full = ((b->size - (size + alignment)) <= b->allocated);
else full = ((b->size - NK_MIN(b->size,(size + alignment))) <= b->allocated);
if (full) {
nk_size capacity;