diff --git a/libmaxsi/heap.cpp b/libmaxsi/heap.cpp index dc82e81d..aa3eb9cf 100644 --- a/libmaxsi/heap.cpp +++ b/libmaxsi/heap.cpp @@ -662,7 +662,7 @@ namespace Maxsi ASSERT(chunk->IsUsed()); ASSERT(chunk->IsSane()); size_t allocsize = chunk->size - OVERHEAD; - if ( allocsize < size ) { return ptr; } + if ( size < allocsize ) { return ptr; } void* newptr = Allocate(size); if ( !newptr ) { return NULL; } Memory::Copy(newptr, ptr, allocsize);