Fix error in BLI_buffer_reinit
authorCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2015 14:36:20 +0000 (01:36 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2015 14:38:59 +0000 (01:38 +1100)
alloc_size was set incorrectly causing arrays not to be resized correctly.

source/blender/blenlib/intern/buffer.c

index 525b18333afd915fbcb9eb291028bff247bd1c6c..e2172148d1edec69ac84e080fdc4c76703faaf2d 100644 (file)
@@ -123,7 +123,7 @@ void BLI_buffer_reinit(BLI_Buffer *buffer, const size_t new_count)
                        buffer->alloc_count = new_count;
                }
 
-               buffer->data = buffer_alloc(buffer, new_count);
+               buffer->data = buffer_alloc(buffer, buffer->alloc_count);
        }
        else {
                if (buffer->flag & BLI_BUFFER_USE_CALLOC) {