Reproduction steps:
1. Open the attached project “MemoryProfilerBug”
2. Open the Memory Profiler “Window>Analysis>Memory Profiler”
3. Select the memory snapshot “Snap1”
4. Open the tab “All of Memory”
5. Expand the list items “Scripting Memory>Managed Objects“
6. Click on the list item “UnityEngine.Terrain“
7. Observe the Console Window
Expected result: No error is being thrown
Actual result: In the Console Window “Index was outside the bounds of the array” error is logged
Reproducible with: 0.7.1-preview.1 (2020.3.44f1, 2021.3.17f1, 2022.1.24f1, 2022.2.0b9), 1.0.0 (2022.2.3f1, 2023.1.0b1, 2023.2.0a3)
Reproducible on: Windows 11