diff options
Diffstat (limited to 'debian/patches/0001-Fix-seeking-in-Cache-Brush-and-other-Secondary-Drawi.patch')
-rw-r--r-- | debian/patches/0001-Fix-seeking-in-Cache-Brush-and-other-Secondary-Drawi.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/debian/patches/0001-Fix-seeking-in-Cache-Brush-and-other-Secondary-Drawi.patch b/debian/patches/0001-Fix-seeking-in-Cache-Brush-and-other-Secondary-Drawi.patch new file mode 100644 index 0000000..d443728 --- /dev/null +++ b/debian/patches/0001-Fix-seeking-in-Cache-Brush-and-other-Secondary-Drawi.patch @@ -0,0 +1,56 @@ +From 8fad44609adae228000e55effae4a05fce1607d9 Mon Sep 17 00:00:00 2001 +From: Giovanni Panozzo <giovanni@panozzo.it> +Date: Wed, 15 Jul 2020 00:08:15 +0200 +Subject: [PATCH 1/2] Fix seeking in Cache Brush and other Secondary Drawing + Orders + +--- + libfreerdp/core/orders.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c +index dc4e51a87..723680322 100644 +--- a/libfreerdp/core/orders.c ++++ b/libfreerdp/core/orders.c +@@ -2611,7 +2611,7 @@ static BOOL update_decompress_brush(wStream* s, BYTE* output, size_t outSize, BY + const BYTE* palette = Stream_Pointer(s) + 16; + const INT32 bytesPerPixel = ((bpp + 1) / 8); + +- if (!Stream_SafeSeek(s, 16ULL + 7ULL * bytesPerPixel)) // 64 / 4 ++ if (Stream_GetRemainingLength(s) < 16 + bytesPerPixel * 4) + return FALSE; + + for (y = 7; y >= 0; y--) +@@ -3605,7 +3605,7 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) + static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags) + { + BOOL rc = FALSE; +- size_t start, end, diff; ++ size_t start, end, pos, diff; + BYTE orderType; + UINT16 extraFlags; + UINT16 orderLength; +@@ -3754,15 +3754,15 @@ static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flag + WLog_Print(update->log, WLOG_ERROR, "SECONDARY ORDER %s failed", name); + } + +- start += orderLength + 7; +- end = Stream_GetPosition(s); +- if (start > end) ++ end = start + orderLength + 7; ++ pos = Stream_GetPosition(s); ++ if (pos > end) + { + WLog_Print(update->log, WLOG_WARN, "SECONDARY_ORDER %s: read %" PRIuz "bytes too much", +- name, end - start); ++ name, pos - end); + return FALSE; + } +- diff = end - start; ++ diff = end - pos; + if (diff > 0) + { + WLog_Print(update->log, WLOG_DEBUG, +-- +2.25.4 + |