fix(pdu): TS_RFX_CHANNELT width/height SHOULD be within range

According to the specification, the value does not need to be in the range:
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdprfx/4060f07e-9d73-454d-841e-131a93aca675

(the ironrdp-server can send larger values)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2025-03-12 21:34:47 +01:00
committed by Benoît Cortier
parent 92dd927ec2
commit 097cdb66f9
@@ -232,17 +232,8 @@ impl<'de> Decode<'de> for RfxChannel {
return Err(invalid_field_err!("channelId", "Invalid channel ID"));
}
let width = src.read_i16();
if !(1..=4096).contains(&width) {
return Err(invalid_field_err!("width", "Invalid channel width"));
}
let width = RfxChannelWidth::new(width);
let height = src.read_i16();
if !(1..=2048).contains(&height) {
return Err(invalid_field_err!("height", "Invalid channel height"));
}
let height = RfxChannelHeight::new(height);
let width = RfxChannelWidth::new(src.read_i16());
let height = RfxChannelHeight::new(src.read_i16());
Ok(Self { width, height })
}