Commit 7ea38278 authored by David Reid's avatar David Reid

Fix a bug with the slot allocator when the cap is not a multiple of 32.

parent 6cdeaace
...@@ -37900,6 +37900,9 @@ MA_API ma_result ma_slot_allocator_alloc(ma_slot_allocator* pAllocator, ma_uint6 ...@@ -37900,6 +37900,9 @@ MA_API ma_result ma_slot_allocator_alloc(ma_slot_allocator* pAllocator, ma_uint6
/* The slot index is required for constructing the output value. */ /* The slot index is required for constructing the output value. */
slotIndex = (iGroup << 5) + bitOffset; /* iGroup << 5 = iGroup * 32 */ slotIndex = (iGroup << 5) + bitOffset; /* iGroup << 5 = iGroup * 32 */
if (slotIndex >= pAllocator->capacity) {
return MA_OUT_OF_MEMORY;
}
/* Increment the reference count before constructing the output value. */ /* Increment the reference count before constructing the output value. */
pAllocator->pSlots[slotIndex] += 1; pAllocator->pSlots[slotIndex] += 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment