render: add missing byte-swap of filter params in SProcRenderSetPictureFilter

SProcRenderSetPictureFilter() swapped the picture and nbytes fields but
did not swap the xFixed (CARD32) filter parameter values that follow the
filter name string in the request body.

Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2181>
This commit is contained in:
Peter Hutterer 2026-04-17 12:02:42 +10:00 committed by Marge Bot
parent e24bd73e9d
commit c98273d0bc

View file

@ -2401,11 +2401,24 @@ SProcRenderQueryFilters(ClientPtr client)
static int _X_COLD
SProcRenderSetPictureFilter(ClientPtr client)
{
int nparams;
char *name;
xFixed *params;
REQUEST(xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
swapl(&stuff->picture);
swaps(&stuff->nbytes);
name = (char *) (stuff + 1);
params = (xFixed *) (name + pad_to_int32(stuff->nbytes));
nparams = ((xFixed *) stuff + client->req_len) - params;
if (nparams < 0)
return BadLength;
SwapLongs((CARD32*)params, nparams);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}