File freerdp_Mask_CACHED_BRUSH_when_checking_brush_style.patch of Package freerdp.27686

From ce1a9d8d1969ecbb4d24b9f4812654638a44abc2 Mon Sep 17 00:00:00 2001
From: Armin Novak <armin.novak@thincast.com>
Date: Tue, 23 Jun 2020 09:24:35 +0200
Subject: [PATCH] Fixed #6298: Mask CACHED_BRUSH when checking brush style

---
 libfreerdp/core/orders.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c
index dc4e51a873..537e694264 100644
--- a/libfreerdp/core/orders.c
+++ b/libfreerdp/core/orders.c
@@ -139,7 +139,8 @@ static BYTE get_bmf_bpp(UINT32 bmf, BOOL* pValid)
 {
 	if (pValid)
 		*pValid = TRUE;
-	switch (bmf)
+	/* Mask out highest bit */
+	switch (bmf & (~CACHED_BRUSH))
 	{
 		case 1:
 			return 1;
openSUSE Build Service is sponsored by