summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_encoder.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-03-18 00:07:11 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-03-18 00:07:11 -0700
commit6d7e315b0c0a1e56e135614f1e2e96fa19870975 (patch)
tree536a8fe4fd25d7c6b615c4350d09f0a114cea293 /xrdp/xrdp_encoder.c
parent63032b000daeaaeb1eed75abc1c70066c9e02581 (diff)
downloadxrdp-proprietary-6d7e315b0c0a1e56e135614f1e2e96fa19870975.tar.gz
xrdp-proprietary-6d7e315b0c0a1e56e135614f1e2e96fa19870975.zip
work on surface command
Diffstat (limited to 'xrdp/xrdp_encoder.c')
-rw-r--r--xrdp/xrdp_encoder.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/xrdp/xrdp_encoder.c b/xrdp/xrdp_encoder.c
index 40c921f1..02b371ec 100644
--- a/xrdp/xrdp_encoder.c
+++ b/xrdp/xrdp_encoder.c
@@ -162,7 +162,7 @@ process_enc(struct xrdp_mm *self, XRDP_ENC_DATA *enc)
LLOGLN(0, ("process_enc: error"));
return 1;
}
- out_data = (char *) g_malloc(out_data_bytes, 0);
+ out_data = (char *) g_malloc(out_data_bytes + 256, 0);
if (out_data == 0)
{
LLOGLN(0, ("process_enc: error"));
@@ -172,11 +172,20 @@ process_enc(struct xrdp_mm *self, XRDP_ENC_DATA *enc)
enc->width, enc->height,
enc->width * 4, x, y, cx, cy,
quality,
- out_data, &out_data_bytes);
+ out_data + 256, &out_data_bytes);
+ if (error < 0)
+ {
+ LLOGLN(0, ("process_enc: jpeg error %d bytes %d",
+ error, out_data_bytes));
+ g_free(out_data);
+ return 1;
+ }
LLOGLN(10, ("jpeg error %d bytes %d", error, out_data_bytes));
- enc_done = g_malloc(sizeof(XRDP_ENC_DATA_DONE), 1);
+ enc_done = (XRDP_ENC_DATA_DONE *)
+ g_malloc(sizeof(XRDP_ENC_DATA_DONE), 1);
enc_done->comp_bytes = out_data_bytes;
- enc_done->comp_data = out_data;
+ enc_done->pad_bytes = 256;
+ enc_done->comp_pad_data = out_data;
enc_done->enc = enc;
enc_done->last = index == (enc->num_crects - 1);
enc_done->index = index;