diff --git a/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp index 0e8a85f1e8..bf5cbaafe9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_time.cpp @@ -177,13 +177,35 @@ s32 sys_time_get_current_time(vm::ptr sec, vm::ptr nsec) // get time since Epoch in nanoseconds const u64 time = s_time_aux_info.start_ftime * 100u + diff; + if (!sec) + { + return CELL_EFAULT; + } + *sec = time / 1000000000u; + + if (!nsec) + { + return CELL_EFAULT; + } + *nsec = time % 1000000000u; #else struct timespec ts; verify(HERE), ::clock_gettime(CLOCK_REALTIME, &ts) == 0; + if (!sec) + { + return CELL_EFAULT; + } + *sec = ts.tv_sec; + + if (!nsec) + { + return CELL_EFAULT; + } + *nsec = ts.tv_nsec; #endif