Fixed zero length allocation.
This commit is contained in:
parent
6c288bd0f2
commit
08f61e60ca
@ -1552,12 +1552,20 @@ skip_encoding_loop:
|
||||
|
||||
if (success && message->numTiles != maxNbTiles)
|
||||
{
|
||||
void* pmem = realloc((void*) message->tiles, sizeof(RFX_TILE*) * message->numTiles);
|
||||
if (message->numTiles > 0)
|
||||
{
|
||||
void* pmem = realloc((void*) message->tiles, sizeof(RFX_TILE*) * message->numTiles);
|
||||
|
||||
if (pmem)
|
||||
message->tiles = (RFX_TILE**) pmem;
|
||||
if (pmem)
|
||||
message->tiles = (RFX_TILE**) pmem;
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
free(message->tiles);
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* when using threads ensure all computations are done */
|
||||
|
Loading…
Reference in New Issue
Block a user