From 608c5d40f6ab4cabd4d5793b2d641f401e146233 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Tue, 28 Apr 2026 04:25:52 +0000 Subject: [PATCH] [cache,bitmap] overallocate bitmap cache Backport of commit ffad58fd2b329efd81a3239e9d7e3c927b8e503f. Adjusted hunk offsets for 2.11.7. Made-with: Cursor --- libfreerdp/cache/bitmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libfreerdp/cache/bitmap.c b/libfreerdp/cache/bitmap.c index 0ce2599..b8a4f21 100644 --- a/libfreerdp/cache/bitmap.c +++ b/libfreerdp/cache/bitmap.c @@ -281,8 +281,10 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) bitmapCache->settings = settings; bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context = bitmapCache->update->context; + + /* overallocate by 1. older RDP servers do send a off by 1 cache index. */ bitmapCache->cells = - (BITMAP_V2_CELL*)calloc(settings->BitmapCacheV2NumCells, sizeof(BITMAP_V2_CELL)); + (BITMAP_V2_CELL*)calloc(settings->BitmapCacheV2NumCells + 1ull, sizeof(BITMAP_V2_CELL)); if (!bitmapCache->cells) goto fail; -- 2.53.0