From 40f7c88982e296545415d1478db8229020a99ce3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 29 May 2017 01:59:12 +0200 Subject: [PATCH] Timers, whose enable and/or count pointers are NULL, are now ignored by timer_process(), should fix the random crashes on hard reset. --- src/timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/timer.c b/src/timer.c index 07cc7c336..d3fd618a7 100644 --- a/src/timer.c +++ b/src/timer.c @@ -39,6 +39,11 @@ void timer_process() for (c = 0; c < timers_present; c++) { + /* This is needed to avoid timer crashes on hard reset. */ + if ((timers[c].enable == NULL) || (timers[c].count == NULL)) + { + continue; + } enable[c] = *timers[c].enable; if (*timers[c].enable) {