forked from MeloNX/MeloNX
hle: Add safety measure around overflow in ScheduleFutureInvocation
Fix crash on Linux since 9fd24c2209ec62dbff4c89f00090945ba70bf33f.
This commit is contained in:
parent
66cea75472
commit
4c282bbff2
@ -44,7 +44,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
|
||||
|
||||
public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout)
|
||||
{
|
||||
long timePoint = PerformanceCounter.ElapsedTicks + ConvertNanosecondsToHostTicks(timeout);
|
||||
long startTime = PerformanceCounter.ElapsedTicks;
|
||||
long timePoint = startTime + ConvertNanosecondsToHostTicks(timeout);
|
||||
|
||||
if (timePoint < startTime)
|
||||
{
|
||||
timePoint = long.MaxValue;
|
||||
}
|
||||
|
||||
lock (_context.CriticalSection.Lock)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user