From 6e6e71d116c9c8883af0577dce2da9bb43a43b25 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 25 Jan 2013 08:34:04 -0800 Subject: [PATCH] Quick fix rtc crash, probably gives wrong results. --- Core/HLE/sceRtc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceRtc.cpp b/Core/HLE/sceRtc.cpp index 8a2c82423..7d1d89902 100644 --- a/Core/HLE/sceRtc.cpp +++ b/Core/HLE/sceRtc.cpp @@ -140,7 +140,12 @@ void __RtcTicksToPspTime(ScePspDateTime &t, u64 ticks) time_t time = (ticks - rtcMagicOffset) / 1000000ULL; t.microsecond = ticks % 1000000ULL; - tm *local = gmtime(&time); + tm *local = gmtime(&time); + if (!local) + { + ERROR_LOG(HLE, "Date is too high/low to handle, pretending to work."); + return; + } t.year = local->tm_year + 1900 - numYearAdd * 400; t.month = local->tm_mon + 1;