orders: Fix OFFSCREEN_DELETE_LIST allocation size

The size of OFFSCREEN_DELETE_LIST list allocation was incorrectly changed
by commit 99b1481 and consequently fixed incorrectly by commit 8a0fe086.
Let's count the allocation size based on new size and not based on current
size in order to prevent some memory issues.

https://github.com/FreeRDP/FreeRDP/issues/4117
This commit is contained in:
Ondrej Holy 2017-09-05 09:56:00 +02:00
parent 048e7f264b
commit 9cccd4888d
1 changed files with 1 additions and 1 deletions

View File

@ -2460,7 +2460,7 @@ static BOOL update_read_create_offscreen_bitmap_order(wStream* s,
if (deleteList->cIndices > deleteList->sIndices) if (deleteList->cIndices > deleteList->sIndices)
{ {
UINT16* new_indices; UINT16* new_indices;
new_indices = (UINT16*)realloc(deleteList->indices, deleteList->sIndices * 2); new_indices = (UINT16*)realloc(deleteList->indices, deleteList->cIndices * 2);
if (!new_indices) if (!new_indices)
return FALSE; return FALSE;