--- a/libfreerdp/core/update.c	2018-08-01 21:27:31.000000000 +0800
+++ b/libfreerdp/core/update.c	2019-04-04 19:20:35.213000000 +0800
@@ -205,11 +205,9 @@ BITMAP_UPDATE* update_read_bitmap_update
 
 	if (bitmapUpdate->number > bitmapUpdate->count)
 	{
-		UINT16 count;
-		BITMAP_DATA* newdata;
-		count = bitmapUpdate->number * 2;
-		newdata = (BITMAP_DATA*) realloc(bitmapUpdate->rectangles,
-		                                 sizeof(BITMAP_DATA) * count);
+		UINT32 count = bitmapUpdate->number * 2;
+		BITMAP_DATA* newdata = (BITMAP_DATA*) realloc(bitmapUpdate->rectangles,
+		                       sizeof(BITMAP_DATA) * count);
 
 		if (!newdata)
 			goto fail;
