diff --git a/BepInEx.IL2CPP/Hook/Allocator/PageAllocator.cs b/BepInEx.IL2CPP/Hook/Allocator/PageAllocator.cs index 59fb28a..a008adc 100644 --- a/BepInEx.IL2CPP/Hook/Allocator/PageAllocator.cs +++ b/BepInEx.IL2CPP/Hook/Allocator/PageAllocator.cs @@ -92,7 +92,7 @@ namespace BepInEx.IL2CPP.Hook.Allocator foreach (var allocatedChunk in allocatedChunks) { long index = (page - allocatedChunk.BaseAddress) / PAGE_SIZE; - if (index < 0 || index > PAGES_PER_UNIT) + if (index < 0 || index >= PAGES_PER_UNIT) continue; allocatedChunk.Pages[index] = false; return;