From 3f5cfe4beefaf6749699e91cacf0ac22d3c5a590 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 16 Feb 2026 17:04:18 +0100 Subject: [PATCH] Return empty MemorySegmentInfo when attempting a out of bounce access --- source/utils/HeapMemoryFixedSize.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/utils/HeapMemoryFixedSize.cpp b/source/utils/HeapMemoryFixedSize.cpp index 52bf463..f0a5f5f 100644 --- a/source/utils/HeapMemoryFixedSize.cpp +++ b/source/utils/HeapMemoryFixedSize.cpp @@ -64,6 +64,7 @@ HeapMemoryFixedSizePool::operator bool() const { HeapMemoryFixedSizePool::MemorySegmentInfo HeapMemoryFixedSizePool::operator[](const int idx) const { if (idx < 0 || idx >= static_cast(mSegmentInfos.size())) { DEBUG_FUNCTION_LINE_ERR("Out of bounce access (tried to access index %d; size is %d", idx, mSegmentInfos.size()); + return {nullptr, 0}; } return mSegmentInfos[idx]; }