diff --git a/libfreerdp/primitives/sse/prim_copy_avx2.c b/libfreerdp/primitives/sse/prim_copy_avx2.c index 644f6f61f..57af2d30c 100644 --- a/libfreerdp/primitives/sse/prim_copy_avx2.c +++ b/libfreerdp/primitives/sse/prim_copy_avx2.c @@ -62,7 +62,7 @@ static INLINE pstatus_t avx2_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDa const SSIZE_T width = nWidth - rem; const size_t align = nSrcStep % 32; - const BOOL fast = (align == 0) ? TRUE : (align >= 8 - MIN(8, rem) ? TRUE : FALSE); + const BOOL fast = (align == 0) ? TRUE : (align >= 8 - MIN(8, (size_t)rem) ? TRUE : FALSE); for (SSIZE_T y = 0; y < nHeight; y++) { const BYTE* WINPR_RESTRICT srcLine = diff --git a/libfreerdp/primitives/sse/prim_copy_sse4_1.c b/libfreerdp/primitives/sse/prim_copy_sse4_1.c index 8419db00a..108123d2b 100644 --- a/libfreerdp/primitives/sse/prim_copy_sse4_1.c +++ b/libfreerdp/primitives/sse/prim_copy_sse4_1.c @@ -57,7 +57,7 @@ static INLINE pstatus_t sse_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDat const SSIZE_T rem = nWidth % 4; const size_t align = nSrcStep % 64; - const BOOL fast = (align == 0) ? TRUE : (align >= 16 - MIN(16, rem) ? TRUE : FALSE); + const BOOL fast = (align == 0) ? TRUE : (align >= 16 - MIN(16, (size_t)rem) ? TRUE : FALSE); const SSIZE_T width = nWidth - rem; for (SSIZE_T y = 0; y < nHeight; y++) { diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index f1406bc26..4958493a1 100644 --- a/winpr/libwinpr/clipboard/synthetic.c +++ b/winpr/libwinpr/clipboard/synthetic.c @@ -602,8 +602,8 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format const long end = strtol(&endStr[8], NULL, 10); - if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end) || - (errno != 0)) + if (beg < 0 || end < 0 || ((size_t)beg > SrcSize) || ((size_t)end > SrcSize) || + (beg >= end) || (errno != 0)) return NULL; const size_t DstSize = (size_t)(end - beg);