Compare commits
4 Commits
master
...
wip/xrandr
Author | SHA1 | Date | |
---|---|---|---|
|
e3f795779b | ||
|
dc76cfc769 | ||
|
4132f66be6 | ||
|
94ddca562a |
|
@ -1755,6 +1755,8 @@ ProcRRSetCrtcTransform(ClientPtr client)
|
|||
filter, nbytes, params, nparams);
|
||||
}
|
||||
|
||||
#define CrtcTransformExtra (SIZEOF(xRRGetCrtcTransformReply) - 32)
|
||||
|
||||
static int
|
||||
transform_filter_length(RRTransformPtr transform)
|
||||
{
|
||||
|
@ -1812,6 +1814,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
|
|||
RRCrtcPtr crtc;
|
||||
int nextra;
|
||||
RRTransformPtr current, pending;
|
||||
char *extra;
|
||||
|
||||
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
||||
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
||||
|
@ -1822,16 +1825,14 @@ ProcRRGetCrtcTransform(ClientPtr client)
|
|||
nextra = (transform_filter_length(pending) +
|
||||
transform_filter_length(current));
|
||||
|
||||
char *extra_buf = calloc(1, nextra);
|
||||
if (!extra_buf)
|
||||
extra = calloc(1, nextra);
|
||||
if (!extra)
|
||||
return BadAlloc;
|
||||
|
||||
char *extra = extra_buf;
|
||||
|
||||
xRRGetCrtcTransformReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(sizeof(xRRGetCrtcTransformReply) - sizeof(xReq) + nextra),
|
||||
.length = bytes_to_int32(CrtcTransformExtra + nextra),
|
||||
.hasTransforms = crtc->transforms,
|
||||
};
|
||||
|
||||
|
@ -1850,8 +1851,8 @@ ProcRRGetCrtcTransform(ClientPtr client)
|
|||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xRRGetCrtcTransformReply), &rep);
|
||||
WriteToClient(client, nextra, extra_buf);
|
||||
free(extra_buf);
|
||||
WriteToClient(client, nextra, extra);
|
||||
free(extra);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue