mirror of https://github.com/FreeRDP/FreeRDP
Fixed zero length allocation.
This commit is contained in:
parent
6c288bd0f2
commit
08f61e60ca
|
@ -1551,6 +1551,8 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, int
|
|||
skip_encoding_loop:
|
||||
|
||||
if (success && message->numTiles != maxNbTiles)
|
||||
{
|
||||
if (message->numTiles > 0)
|
||||
{
|
||||
void* pmem = realloc((void*) message->tiles, sizeof(RFX_TILE*) * message->numTiles);
|
||||
|
||||
|
@ -1559,6 +1561,12 @@ skip_encoding_loop:
|
|||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
free(message->tiles);
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* when using threads ensure all computations are done */
|
||||
message->tilesDataSize = 0;
|
||||
|
|
Loading…
Reference in New Issue