Fix critical overflow in random computation
This commit is contained in:
parent
e714322250
commit
e2cd5b4e2d
1 changed files with 2 additions and 2 deletions
|
@ -272,9 +272,9 @@ namespace Ryujinx.HLE.HOS.Services.Ro
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
int randomOffset = _random.Next(0, (int)addressSpacePageLimit) << 12;
|
ulong randomOffset = (ulong)(uint)_random.Next(0, (int)addressSpacePageLimit) << 12;
|
||||||
|
|
||||||
targetAddress = memMgr.GetAddrSpaceBaseAddr() + (ulong)randomOffset;
|
targetAddress = memMgr.GetAddrSpaceBaseAddr() + randomOffset;
|
||||||
|
|
||||||
if (memMgr.InsideAddrSpace(targetAddress, size) && !memMgr.InsideHeapRegion(targetAddress, size) && !memMgr.InsideAliasRegion(targetAddress, size))
|
if (memMgr.InsideAddrSpace(targetAddress, size) && !memMgr.InsideHeapRegion(targetAddress, size) && !memMgr.InsideAliasRegion(targetAddress, size))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue