diff options
author | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2015-09-01 08:49:31 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@theqtcompany.com> | 2015-09-02 10:21:37 +0000 |
commit | 4b340402b97b83790b3d71a8244a246eec4f8abd (patch) | |
tree | 5af9806dfc5b450927d95251290ed96df1825172 /src/corelib/kernel/qeventdispatcher_winrt.cpp | |
parent | 8981703817f2a1a54a788d30e721935cec5ed9b8 (diff) |
WinRT: Fixed possible integer overflow in timer registration code
Task-number: QTBUG-48012
Change-Id: If1b80e59c13230bc0a62c6fa3d45b6e2272b9e28
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_winrt.cpp')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_winrt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp index f771974a24..490a7c566a 100644 --- a/src/corelib/kernel/qeventdispatcher_winrt.cpp +++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp @@ -288,7 +288,8 @@ void QEventDispatcherWinRT::registerTimer(int timerId, int interval, Qt::TimerTy } TimeSpan period; - period.Duration = interval ? (interval * 10000) : 1; // TimeSpan is based on 100-nanosecond units + // TimeSpan is based on 100-nanosecond units + period.Duration = qMax(qint64(1), qint64(interval) * 10000); const HANDLE handle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE | EVENT_MODIFY_STATE); const HANDLE cancelHandle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE|EVENT_MODIFY_STATE); HRESULT hr = runOnXamlThread([&]() { |