From e7433ec69c98d194fbd0e2723b692cf72e3a7a9f Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 21 Nov 2016 18:00:41 -0800 Subject: [PATCH 1/2] Fix pointer sign warnings in JPEG compression code --- libxrdp/xrdp_jpeg_compress.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libxrdp/xrdp_jpeg_compress.c b/libxrdp/xrdp_jpeg_compress.c index 27c31639..bcf66866 100644 --- a/libxrdp/xrdp_jpeg_compress.c +++ b/libxrdp/xrdp_jpeg_compress.c @@ -213,7 +213,7 @@ xrdp_jpeg_deinit(void *handle) struct mydata_comp { - char *cb; + JOCTET *cb; int cb_bytes; int total_done; int overwrite; @@ -265,8 +265,8 @@ my_term_destination(j_compress_ptr cinfo) /*****************************************************************************/ static int APP_CC -jp_do_compress(char *data, int width, int height, int bpp, int quality, - char *comp_data, int *comp_data_bytes) +jp_do_compress(JOCTET *data, int width, int height, int bpp, int quality, + JOCTET *comp_data, int *comp_data_bytes) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; @@ -336,9 +336,8 @@ jpeg_compress(char *in_data, int width, int height, struct stream *s, struct stream *temp_s, int bpp, int byte_limit, int e, int quality) { - char *data; + JOCTET *data; tui32 *src32; - tui16 *src16; tui8 *dst8; tui32 pixel; int red; @@ -348,7 +347,7 @@ jpeg_compress(char *in_data, int width, int height, int i; int cdata_bytes; - data = temp_s->data; + data = (JOCTET *) temp_s->data; dst8 = data; if (bpp == 24) @@ -380,7 +379,8 @@ jpeg_compress(char *in_data, int width, int height, } cdata_bytes = byte_limit; - jp_do_compress(data, width + e, height, 24, quality, s->p, &cdata_bytes); + jp_do_compress(data, width + e, height, 24, quality, (JOCTET *) s->p, + &cdata_bytes); s->p += cdata_bytes; return cdata_bytes; } From 077e3f5bfc10937ea99a7de71fc867545126633e Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 21 Nov 2016 19:14:17 -0800 Subject: [PATCH 2/2] Fix pointer sign warnings in TurboJPEG compression code --- libxrdp/xrdp_jpeg_compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libxrdp/xrdp_jpeg_compress.c b/libxrdp/xrdp_jpeg_compress.c index bcf66866..385203a6 100644 --- a/libxrdp/xrdp_jpeg_compress.c +++ b/libxrdp/xrdp_jpeg_compress.c @@ -160,12 +160,12 @@ xrdp_codec_jpeg_compress(void *handle, * TJPF_ARGB no works, zero bytes */ error = tjCompress(tj_han, /* opaque handle */ - src_ptr, /* source buf */ + (unsigned char *) src_ptr, /* source buf */ cx, /* width of area to compress */ stride, /* pitch */ cy, /* height of area to compress */ TJPF_XBGR, /* pixel size */ - out_data, /* dest buf */ + (unsigned char *) out_data, /* dest buf */ &lio_len, /* inner_buf length & compressed_size */ TJSAMP_420, /* jpeg sub sample */ quality, /* jpeg quality */