mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-11-19 17:21:15 +01:00
hle: Add safety measure around overflow in ScheduleFutureInvocation
Fix crash on Linux since 08831eecf7.
This commit is contained in:
1 parent
d6b86a6629
commit
8639245533
1 file changed
+7
-1
@@ -44,7 +44,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
|
|||||||
|
|
||||||
public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout)
|
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)
|
lock (_context.CriticalSection.Lock)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user