Reproduction steps:
1. Create a new project
2. Right-click and create a new Terrain GameObject (3D Object -> Terrain)
3. In the Inspector window, select “Paint Details”
4. Go to “Edit Details” → “Add Grass texture”
5. Under Detail Texture, select any 2D texture
6. Click “Add”
7. Paint on the edge or corner of the Terrain
8. Observe the Console window
Actual result: “IndexOutOfRangeException: Index was outside the bounds of the array.” is thrown in the Console window
Expected result: No exceptions are thrown in the Console window
Reproducible with: 6000.5.0a4, 6000.5.7f1, 6000.6.0b7, 6000.7.0a4
Not reproducible with: 6000.0.81f1, 6000.3.21f1, 6000.5.0a3
Reproduced on: Windows 10 (by user), Windows 11
Not reproduced on: No other environments tested
Note: Issue also reproduces if you add Detail Mesh instead of Grass texture