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>
This commit is contained in:
parent
7706c2a28e
commit
5aff671eea
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user