Blame SOURCES/cover-the-case-of-servers-asking-for-cached-bitmaps-.patch

24c59a
From 807e2ee016386a396b7b57c3c675ff64e8b12f74 Mon Sep 17 00:00:00 2001
24c59a
From: Daryl Poe <daryl.poe@hp.com>
24c59a
Date: Thu, 25 Jul 2013 15:01:56 -0600
24c59a
Subject: [PATCH] cover the case of servers asking for cached bitmaps they have
24c59a
 never defined
24c59a
24c59a
---
24c59a
 libfreerdp-cache/bitmap.c | 6 ++++++
24c59a
 1 file changed, 6 insertions(+)
24c59a
24c59a
diff --git a/libfreerdp-cache/bitmap.c b/libfreerdp-cache/bitmap.c
24c59a
index c1583ac..9ed241d 100644
24c59a
--- a/libfreerdp-cache/bitmap.c
24c59a
+++ b/libfreerdp-cache/bitmap.c
24c59a
@@ -33,6 +33,9 @@ void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
24c59a
 	else
24c59a
 		bitmap = bitmap_cache_get(cache->bitmap, (uint8) memblt->cacheId, memblt->cacheIndex);
24c59a
 
24c59a
+	/* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
24c59a
+	if (bitmap == NULL) return;
24c59a
+
24c59a
 	memblt->bitmap = bitmap;
24c59a
 	IFCALL(cache->bitmap->MemBlt, context, memblt);
24c59a
 }
24c59a
@@ -47,6 +50,9 @@ void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
24c59a
 	else
24c59a
 		bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex);
24c59a
 
24c59a
+	/* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
24c59a
+	if (bitmap == NULL) return;
24c59a
+
24c59a
 	mem3blt->bitmap = bitmap;
24c59a
 	IFCALL(cache->bitmap->Mem3Blt, context, mem3blt);
24c59a
 }
24c59a
-- 
24c59a
2.5.0
24c59a