diff options
author | Wladimir Leuschner <wladimir.leuschner@qt.io> | 2023-11-27 10:42:50 +0100 |
---|---|---|
committer | Wladimir Leuschner <wladimir.leuschner@qt.io> | 2023-11-28 18:59:48 +0000 |
commit | 5aff671eea43c1c28990591a8e7d65af05496755 (patch) | |
tree | 42388041cae627a76b2b438830ae52f6717a2773 | |
parent | 7706c2a28ea5995f828144e39b8d1662aa263aa2 (diff) |
Fix signed integer overflow in handling WM_SIZE message
The width and height of WM_SIZE parameters in LPARAM are unsigned ints,
but were extracted as signed ints with GET_X_LPARAM and GET_Y_LPARAM,
leading to signed integer overflow when using big window sizes.
The width and height are now extracted with LOWORD and HIWORD.
Fixes: QTBUG-119424
Pick-to: 6.6
Change-Id: Ie68716a08a686739b6464ce76319dc659fede336
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index c2e1df0521..69e6d8c980 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1121,7 +1121,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, d->m_creationContext->applyToMinMaxInfo(reinterpret_cast<MINMAXINFO *>(lParam)); return true; case QtWindows::ResizeEvent: - d->m_creationContext->obtainedSize = QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); + d->m_creationContext->obtainedSize = QSize(LOWORD(lParam), HIWORD(lParam)); return true; case QtWindows::MoveEvent: d->m_creationContext->obtainedPos = QPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); |