[PATCH] RDP compositor take 5
Hardening
rdp.effort at gmail.com
Mon Apr 1 13:36:24 PDT 2013
On 30/03/2013 21:34, Jason Ekstrand wrote:
[...]
>> + cmd->codecID = peer->settings->RemoteFxCodecId;
>> + cmd->width = width;
>> + cmd->height = height;
>> +
>> + ptr = pixman_image_get_data(image) + damage->extents.x1 +
>> + damage->extents.y1 * pixman_image_get_width(image);
>
> that should be pixman_image_get_stride
>
I don't think so as ptr is a uint32 pointer
>> +
>> + rects = pixman_region32_rectangles(damage, &nrects);
>> + if(context->rfx_rects)
>> + context->rfx_rects = malloc(nrects * sizeof *rfxRect);
>> + else
>> + context->rfx_rects = realloc(context->rfx_rects, nrects * sizeof *rfxRect);
>
> You can use realloc in both cases here. If the first argument is a
> null, it will allocate fresh memory.
>
good catch.
> +
>> +
>> +static void
>> +rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_peer *peer)
>> +{
[...]
>> + cmd->codecID = peer->settings->NSCodecId;
>> + cmd->width = width;
>> + cmd->height = height;
>> +
>> + ptr = pixman_image_get_data(image) + damage->extents.x1 +
>> + damage->extents.y1 * pixman_image_get_width(image);
>
> pixman_image_get_stride
same as above
Hardening.
More information about the wayland-devel
mailing list