Merge pull request #18946 from nemerle/fix_poolallocator_resize

Fix PoolAllocator::resize for too large p_new_size
This commit is contained in:
Rémi Verschelde 2018-05-17 08:11:53 +02:00 committed by GitHub
commit 18203b7e78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -359,7 +359,7 @@ Error PoolAllocator::resize(ID p_mem, int p_new_size) {
//p_new_size = align(p_new_size)
int _free = free_mem; // - static_area_size;
if ((_free + aligned(e->len)) - alloc_size < 0) {
if (uint32_t(_free + aligned(e->len)) < alloc_size) {
mt_unlock();
ERR_FAIL_V(ERR_OUT_OF_MEMORY);
};