summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-03-28 00:43:17 +0000
committerjsorg71 <jsorg71>2005-03-28 00:43:17 +0000
commite61e379a92a7d72bcfe84c63963fb815a2de4a7e (patch)
tree829bc508aa82e95e8787cd0d0020e005e9d34121
parent959be9d2a2ef6f4f34dca19df007f30b7d5e8d45 (diff)
downloadxrdp-proprietary-e61e379a92a7d72bcfe84c63963fb815a2de4a7e.tar.gz
xrdp-proprietary-e61e379a92a7d72bcfe84c63963fb815a2de4a7e.zip
fix crash with large cursors
-rw-r--r--vnc/vnc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vnc/vnc.c b/vnc/vnc.c
index 375c8c11..63c1e2f2 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -513,7 +513,6 @@ int lib_framebuffer_update(struct vnc* v)
data_size = need_size;
}
error = lib_recv(v, data, need_size);
- /*g_printf("%d %d\n", i, need_size);*/
if (error == 0)
{
error = v->server_paint_rect(v, x, y, cx, cy, data);
@@ -534,12 +533,14 @@ int lib_framebuffer_update(struct vnc* v)
{
g_memset(cursor_data, 0, 32 * (32 * 3));
g_memset(cursor_mask, 0, 32 * (32 / 8));
- init_stream(s, 8192);
- error = lib_recv(v, s->data, cx * cy * Bpp + ((cx + 7) / 8) * cy);
+ j = cx * cy * Bpp;
+ k = ((cx + 7) / 8) * cy;
+ init_stream(s, j + k);
+ error = lib_recv(v, s->data, j + k);
if (error == 0)
{
- in_uint8p(s, d1, cx * cy * Bpp);
- in_uint8p(s, d2, ((cx + 7) / 8) * cy);
+ in_uint8p(s, d1, j);
+ in_uint8p(s, d2, k);
for (j = 0; j < 32; j++)
{
for (k = 0; k < 32; k++)