From ecce27f9dab746540ebca9ab470e6d10bcd0dfcc Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 17 Mar 2014 08:41:53 +0100 Subject: [PATCH] Fix null pointer dereference in Timer::AdjustTimers. Fixes #5783 --- lib/base/timer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/base/timer.cpp b/lib/base/timer.cpp index 63fbd669d..347b9186f 100644 --- a/lib/base/timer.cpp +++ b/lib/base/timer.cpp @@ -244,6 +244,9 @@ void Timer::AdjustTimers(double adjustment) for (it = idx.begin(); it != idx.end(); it++) { Timer::Ptr timer = it->lock(); + if (!timer) + continue; + if (abs(now - (timer->m_Next + adjustment)) < abs(now - timer->m_Next)) { timer->m_Next += adjustment;