randr: add swapped dispatch for RR[GS]etCrtcTransform
Fix a memory leak in ProcRRGetCrtcTransform() while I'm at it. Signed-off-by: Julien Cristau <jcristau@debian.org> Cc: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
110a71d11a
commit
0b5ecabfb8
|
@ -1150,8 +1150,7 @@ transform_filter_encode (ClientPtr client, char *output,
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps (nbytesFilter, n);
|
swaps (nbytesFilter, n);
|
||||||
swaps (nparamsFilter, n);
|
swaps (nparamsFilter, n);
|
||||||
SwapLongs ((CARD32 *) (output + nbytes),
|
SwapLongs ((CARD32 *) (output + nbytes), nparams);
|
||||||
nparams * sizeof (xFixed));
|
|
||||||
}
|
}
|
||||||
nbytes += nparams * sizeof (xFixed);
|
nbytes += nparams * sizeof (xFixed);
|
||||||
return nbytes;
|
return nbytes;
|
||||||
|
@ -1162,7 +1161,7 @@ transform_encode (ClientPtr client, xRenderTransform *wire, PictTransform *pict)
|
||||||
{
|
{
|
||||||
xRenderTransform_from_PictTransform (wire, pict);
|
xRenderTransform_from_PictTransform (wire, pict);
|
||||||
if (client->swapped)
|
if (client->swapped)
|
||||||
SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform));
|
SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform) >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1214,5 +1213,6 @@ ProcRRGetCrtcTransform (ClientPtr client)
|
||||||
swapl (&reply->length, n);
|
swapl (&reply->length, n);
|
||||||
}
|
}
|
||||||
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
|
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
|
||||||
|
xfree(reply);
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,21 +367,36 @@ SProcRRSetCrtcGamma (ClientPtr client)
|
||||||
static int
|
static int
|
||||||
SProcRRSetCrtcTransform (ClientPtr client)
|
SProcRRSetCrtcTransform (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
int n, nparams;
|
||||||
|
char *filter;
|
||||||
|
CARD32 *params;
|
||||||
REQUEST(xRRSetCrtcTransformReq);
|
REQUEST(xRRSetCrtcTransformReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRRSetCrtcTransformReq);
|
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
|
||||||
(void) stuff;
|
swaps(&stuff->length, n);
|
||||||
return BadImplementation;
|
swapl(&stuff->crtc, n);
|
||||||
|
SwapLongs((CARD32 *)&stuff->transform, (sizeof(xRenderTransform)) >> 2);
|
||||||
|
swaps(&stuff->nbytesFilter, n);
|
||||||
|
filter = (char *)(stuff + 1);
|
||||||
|
params = (CARD32 *) (filter + ((stuff->nbytesFilter + 3) & ~3));
|
||||||
|
nparams = ((CARD32 *) stuff + client->req_len) - params;
|
||||||
|
if (nparams < 0)
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
|
SwapLongs(params, nparams);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SProcRRGetCrtcTransform (ClientPtr client)
|
SProcRRGetCrtcTransform (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
int n;
|
||||||
REQUEST(xRRGetCrtcTransformReq);
|
REQUEST(xRRGetCrtcTransformReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
||||||
(void) stuff;
|
swaps(&stuff->length, n);
|
||||||
return BadImplementation;
|
swapl(&stuff->crtc, n);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
|
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
|
||||||
|
|
Loading…
Reference in New Issue