mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 18:10:48 -07:00
Avoid LM service crashes by not reading more than the buffer size (#4701)
This commit is contained in:
@ -33,6 +33,11 @@ namespace Ryujinx.Common.Memory
|
||||
return data;
|
||||
}
|
||||
|
||||
public ReadOnlySpan<byte> GetSpanSafe(int size)
|
||||
{
|
||||
return GetSpan((int)Math.Min((uint)_input.Length, (uint)size));
|
||||
}
|
||||
|
||||
public T ReadAt<T>(int offset) where T : unmanaged
|
||||
{
|
||||
return MemoryMarshal.Cast<byte, T>(_input.Slice(offset))[0];
|
||||
|
Reference in New Issue
Block a user