cover the case of servers asking for cached bitmaps they have never defined
authorDaryl Poe <daryl.poe@hp.com>
Thu, 25 Jul 2013 21:01:56 +0000 (15:01 -0600)
committerBernhard Miklautz <bmiklautz@thinstuff.at>
Fri, 26 Jul 2013 09:46:20 +0000 (11:46 +0200)
(cherry picked from commit 46a691db029912e5814b0c6fb36002a41e597825)

libfreerdp/cache/bitmap.c

index a1136a0..fcd653b 100644 (file)
@@ -40,6 +40,8 @@ void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
                bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
        else
                bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId, memblt->cacheIndex);
+       /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
+       if (bitmap == NULL) return;
 
        memblt->bitmap = bitmap;
        IFCALL(cache->bitmap->MemBlt, context, memblt);
@@ -56,6 +58,8 @@ void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
                bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
        else
                bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId, mem3blt->cacheIndex);
+       /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
+       if (bitmap == NULL) return;
 
        style = brush->style;