Fix #4725: Need to copy data.

This commit is contained in:
Armin Novak 2018-07-05 08:44:42 +02:00
parent a0fddd1747
commit 8f7dbe5051
1 changed files with 8 additions and 2 deletions

View File

@ -127,8 +127,14 @@ static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s,
if (Stream_GetRemainingLength(s) < bitmapData->bitmapLength)
return FALSE;
Stream_GetPointer(s, bitmapData->bitmapDataStream);
if (bitmapData->bitmapLength > 0)
{
bitmapData->bitmapDataStream = malloc(bitmapData->bitmapLength);
if (!bitmapData->bitmapDataStream)
return FALSE;
memcpy(bitmapData->bitmapDataStream, Stream_Pointer(s), bitmapData->bitmapLength);
Stream_Seek(s, bitmapData->bitmapLength);
}
return TRUE;
}