Remove a bit of unsafety around

This commit is contained in:
Mary 2021-10-26 23:09:24 +02:00
parent 5c66a36ed6
commit 791ccb7444
4 changed files with 29 additions and 49 deletions

View file

@ -59,23 +59,23 @@ namespace Ryujinx.HLE.HOS.Services.Ro
{
return ResultCode.InvalidNrr;
}
else if (header.NrrSize != nrrSize)
else if (header.Size != nrrSize)
{
return ResultCode.InvalidSize;
}
List<byte[]> hashes = new List<byte[]>();
for (int i = 0; i < header.HashCount; i++)
for (int i = 0; i < header.HashesCount; i++)
{
byte[] temp = new byte[0x20];
byte[] hash = new byte[0x20];
_owner.CpuMemory.Read(nrrAddress + header.HashOffset + (uint)(i * 0x20), temp);
_owner.CpuMemory.Read(nrrAddress + header.HashesOffset + (uint)(i * 0x20), hash);
hashes.Add(temp);
hashes.Add(hash);
}
nrrInfo = new NrrInfo((ulong)nrrAddress, header, hashes);
nrrInfo = new NrrInfo(nrrAddress, header, hashes);
return ResultCode.Success;
}