libfreerdp-codec: fix automatic growing of the encode stream size

This commit is contained in:
Marc-André Moreau 2013-08-12 13:13:27 -04:00
parent 356186ed54
commit e91f2516e5
2 changed files with 16 additions and 9 deletions

View File

@ -1199,13 +1199,20 @@ static void rfx_compose_message_tileset(RFX_CONTEXT* context, wStream* s,
if (context->priv->UseThreads)
{
for (i = 0; i < numTiles; i++)
for (yIdx = 0; yIdx < numTilesY; yIdx++)
{
for (xIdx = 0; xIdx < numTilesX; xIdx++)
{
i = yIdx * numTilesX + xIdx;
WaitForThreadpoolWorkCallbacks(work_objects[i], FALSE);
CloseThreadpoolWork(work_objects[i]);
Stream_EnsureRemainingCapacity(s, Stream_GetPosition(params[i].s));
Stream_Write(s, Stream_Buffer(params[i].s), Stream_GetPosition(params[i].s));
StreamPool_Return(context->priv->EncoderStreamPool, params[i].s);
CloseThreadpoolWork(work_objects[i]);
Stream_Release(params[i].s);
}
}
free(work_objects);
free(params);
}

View File

@ -174,9 +174,9 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, i
while (y_exceed > 0)
{
memcpy(r_buf, r_last, 64 * sizeof(INT16));
memcpy(g_buf, g_last, 64 * sizeof(INT16));
memcpy(b_buf, b_last, 64 * sizeof(INT16));
CopyMemory(r_buf, r_last, 64 * sizeof(INT16));
CopyMemory(g_buf, g_last, 64 * sizeof(INT16));
CopyMemory(b_buf, b_last, 64 * sizeof(INT16));
r_buf += 64;
g_buf += 64;
b_buf += 64;