Fix over-allocation in rfx encoder setup

This commit is contained in:
matt335672 2021-12-22 10:37:24 +00:00
parent 73b66c21be
commit c9f1346fcc

View File

@ -348,7 +348,7 @@ process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
{
alloc_bytes = XRDP_SURCMD_PREFIX_BYTES;
alloc_bytes += self->max_compressed_bytes;
alloc_bytes += sizeof(struct rfx_tile) * enc->num_crects +
alloc_bytes += sizeof(struct rfx_tile) * tiles_left +
sizeof(struct rfx_rect) * enc->num_drects;
out_data = g_new(char, alloc_bytes);
if (out_data != NULL)