Use symbols for desktop size limits

This commit is contained in:
matt335672
2026-06-08 11:12:07 +01:00
parent 2a94fc9674
commit f94ae70148
+6 -2
View File
@@ -984,13 +984,17 @@ skip_encoding(struct vnc *v, int x, int y, int cx, int cy,
* @param cy height of update
* @return 0 if the proposed sizes could result in overflow
*
* [MS-RDPBCGR] allows for a max desktop size of 32766 x 32766.
* [MS-RDPBCGR] allows for a max desktop size of
* CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH x
* CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT
* Each pixel needs up to 4 bytes
*/
static int
framebuffer_update_size_ok(int cx, int cy)
{
return (cx <= 32766 && cy <= 32766 && (cx * cy) <= (INT_MAX / 4));
return (cx <= CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH &&
cy <= CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT &&
(cx * cy) <= (INT_MAX / 4));
}
/**************************************************************************//**