Commit 4b340402 authored by Oliver Wolff's avatar Oliver Wolff
Browse files

WinRT: Fixed possible integer overflow in timer registration code


Task-number: QTBUG-48012
Change-Id: If1b80e59c13230bc0a62c6fa3d45b6e2272b9e28
Reviewed-by: default avatarAndrew Knight <andrew.knight@intopalo.com>
Showing with 2 additions and 1 deletion
......@@ -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([&]() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment