Missing bounds check

This commit is contained in:
gdkchan 2024-09-15 02:14:43 -03:00
parent 8be4c0268d
commit 04545ec814

View file

@ -278,6 +278,12 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <returns>The texture descriptor with the given ID</returns>
public ref readonly TextureDescriptor GetForBinding(int id, Format format, out Texture texture)
{
if ((uint)id >= Items.Length)
{
texture = null;
return ref _defaultDescriptor;
}
ref readonly TextureDescriptor descriptor = ref GetInternal(id, out texture);
if (texture != null && format != 0 && texture.Format != format)