summaryrefslogtreecommitdiff
path: root/hw/xfree86/dixmods/extmod/xf86vmode.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/dixmods/extmod/xf86vmode.c')
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 68c4b583f..ac3bee08f 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -1362,7 +1362,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
rep.flags = 0;
if (!ClockProg) {
- Clocks = malloc(numClocks * sizeof(int));
+ Clocks = calloc(numClocks, sizeof(int));
if (!Clocks)
return BadValue;
if (!VidModeGetClocks(stuff->screen, Clocks)) {
@@ -1489,14 +1489,14 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
REQUEST(xXF86VidModeGetGammaRampReq);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (stuff->size != VidModeGetGammaRampSize(stuff->screen))
return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
-
length = (stuff->size + 1) & ~1;
if (stuff->size) {
@@ -1537,11 +1537,11 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
REQUEST(xXF86VidModeGetGammaRampSizeReq);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
-
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -1564,11 +1564,11 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
REQUEST(xXF86VidModeGetPermissionsReq);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
+
if (stuff->screen >= screenInfo.numScreens)
return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
-
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;