Fix texture slice out-of-bounds error

This commit is contained in:
Exter-N 2025-12-12 23:08:56 +01:00 committed by Ottermandias
parent 5fc8209c85
commit 50b6d773ef

View file

@ -136,7 +136,7 @@ public sealed unsafe class MaterialTemplatePickers : IUiService
continue;
var texture = textureRHs[j].Value->CsHandle.Texture;
if (texture == null)
if (texture == null || sliceIndex >= texture->ArraySize)
continue;
var handle = _textureArraySlicer.GetImGuiHandle(texture, sliceIndex);