Missing bounds check
This commit is contained in:
parent
8be4c0268d
commit
04545ec814
1 changed files with 6 additions and 0 deletions
|
@ -278,6 +278,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// <returns>The texture descriptor with the given ID</returns>
|
/// <returns>The texture descriptor with the given ID</returns>
|
||||||
public ref readonly TextureDescriptor GetForBinding(int id, Format format, out Texture texture)
|
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);
|
ref readonly TextureDescriptor descriptor = ref GetInternal(id, out texture);
|
||||||
|
|
||||||
if (texture != null && format != 0 && texture.Format != format)
|
if (texture != null && format != 0 && texture.Format != format)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue