mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-18 12:22:01 +00:00
Fix exception when trying to read output pointer buffer size (#6221)
* Fix exception when trying to read output pointer buffer size * Better name
This commit is contained in:
parent
8bf102d2cd
commit
ccbbaddbcb
3 changed files with 5 additions and 1 deletions
|
@ -181,6 +181,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
}
|
||||
|
||||
Span<uint> dataWords = Span<uint>.Empty;
|
||||
Span<uint> dataWordsPadded = Span<uint>.Empty;
|
||||
|
||||
if (meta.DataWordsCount != 0)
|
||||
{
|
||||
|
@ -189,6 +190,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
int padding = (dataOffsetAligned - dataOffset) / sizeof(uint);
|
||||
|
||||
dataWords = MemoryMarshal.Cast<byte, uint>(data)[padding..meta.DataWordsCount];
|
||||
dataWordsPadded = MemoryMarshal.Cast<byte, uint>(data)[..meta.DataWordsCount];
|
||||
|
||||
data = data[(meta.DataWordsCount * sizeof(uint))..];
|
||||
}
|
||||
|
@ -209,6 +211,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
ReceiveBuffers = receiveBuffers,
|
||||
ExchangeBuffers = exchangeBuffers,
|
||||
DataWords = dataWords,
|
||||
DataWordsPadded = dataWordsPadded,
|
||||
ReceiveList = receiveList,
|
||||
CopyHandles = copyHandles,
|
||||
MoveHandles = moveHandles,
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
public Span<HipcBufferDescriptor> ReceiveBuffers;
|
||||
public Span<HipcBufferDescriptor> ExchangeBuffers;
|
||||
public Span<uint> DataWords;
|
||||
public Span<uint> DataWordsPadded;
|
||||
public Span<HipcReceiveListEntry> ReceiveList;
|
||||
public Span<int> CopyHandles;
|
||||
public Span<int> MoveHandles;
|
||||
|
|
|
@ -206,7 +206,7 @@ namespace Ryujinx.Horizon.Sdk.Sf
|
|||
}
|
||||
else
|
||||
{
|
||||
var data = MemoryMarshal.Cast<uint, byte>(context.Request.Data.DataWords);
|
||||
var data = MemoryMarshal.Cast<uint, byte>(context.Request.Data.DataWordsPadded);
|
||||
var recvPointerSizes = MemoryMarshal.Cast<byte, ushort>(data[runtimeMetadata.UnfixedOutPointerSizeOffset..]);
|
||||
|
||||
size = recvPointerSizes[unfixedRecvPointerIndex++];
|
||||
|
|
Loading…
Reference in a new issue