From 95a857c2d3212c0a19aefd11ff960df56d413acc Mon Sep 17 00:00:00 2001 From: Nick Ratelle Date: Thu, 5 Jan 2012 16:48:58 -0500 Subject: Fixed null pointer dereference in QUnifiedTimer Change-Id: I8b7ab19a98e2920fc020043088c32d073aa1d60d Reviewed-by: David Faure --- src/corelib/animation/qabstractanimation.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 8fa4707..7c2d690 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -392,13 +392,16 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish() void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d) { - if (driver->isRunning()) { - qWarning("QUnifiedTimer: Cannot change animation driver while animations are running"); - return; - } + if (driver) { + + if (driver->isRunning()) { + qWarning("QUnifiedTimer: Cannot change animation driver while animations are running"); + return; + } - if (driver && driver != &defaultDriver) - delete driver; + if (driver != &defaultDriver) + delete driver; + } driver = d; } -- cgit v0.12