diff options
author | speidy <speidy@gmail.com> | 2014-04-02 07:33:02 +0300 |
---|---|---|
committer | speidy <speidy@gmail.com> | 2014-04-02 07:33:02 +0300 |
commit | 7e9e343d7c06c3f1300c6b71b58c648df647d724 (patch) | |
tree | e9e5c7929b020509b79d0dbdbae3c4da375c29c2 /libxrdp/xrdp_caps.c | |
parent | d0c2fd08f6a9df84fa6b78ca4b3966848a0d69d5 (diff) | |
download | xrdp-proprietary-7e9e343d7c06c3f1300c6b71b58c648df647d724.tar.gz xrdp-proprietary-7e9e343d7c06c3f1300c6b71b58c648df647d724.zip |
libxrdp: make sure jpeg quality is valid
Diffstat (limited to 'libxrdp/xrdp_caps.c')
-rw-r--r-- | libxrdp/xrdp_caps.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c index 918bf4a0..a5883a01 100644 --- a/libxrdp/xrdp_caps.c +++ b/libxrdp/xrdp_caps.c @@ -37,7 +37,7 @@ xrdp_caps_send_monitorlayout(struct xrdp_rdp *self) return 1; } - out_uint32_le(s, self->client_info.monitorCount); /* MonitorCount */ + out_uint32_le(s, self->client_info.monitorCount); /* monitorCount (4 bytes) */ /* TODO: validate for allowed monitors in terminal server (maybe by config?) */ for (i = 0; i < self->client_info.monitorCount; i++) @@ -477,7 +477,14 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) i1 = MIN(64, codec_properties_length); g_memcpy(self->client_info.jpeg_prop, s->p, i1); self->client_info.jpeg_prop_len = i1; - g_writeln(" jpeg quality %d", self->client_info.jpeg_prop[0]); + /* make sure that requested quality is between 0 to 100 */ + if (self->client_info.jpeg_prop[0] < 0 || self->client_info.jpeg_prop[0] > 100) + { + g_writeln(" Warning: the requested jpeg quality (%d) is invalid," + " falling back to default", self->client_info.jpeg_prop[0]); + self->client_info.jpeg_prop[0] = 75; /* use default */ + } + g_writeln(" jpeg quality set to %d", self->client_info.jpeg_prop[0]); } else { @@ -893,7 +900,7 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self) } DEBUG(("out (1) xrdp_caps_send_demand_active")); - /* send Monitor Layout PDU for multimon */ + /* send Monitor Layout PDU for dual monitor */ if (self->client_info.monitorCount > 0 && self->client_info.multimon == 1) { |