summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'randr/rrcrtc.c')
-rw-r--r--randr/rrcrtc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 5fe6900b1..0fc818887 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1750,6 +1750,9 @@ ProcRRSetCrtcConfigs (ClientPtr client)
screen_config.mm_width = stuff->widthInMillimeters;
screen_config.mm_height = stuff->heightInMillimeters;
+ if (num_configs == 0)
+ return Success;
+
output_ids = (RROutput *) (x_configs + num_configs);
/*
@@ -1757,7 +1760,7 @@ ProcRRSetCrtcConfigs (ClientPtr client)
* server crtc configurations
*/
configs = calloc(num_configs, sizeof (RRCrtcConfigRec));
- if (num_configs > 0 && configs == NULL)
+ if (!configs)
return BadAlloc;
for (i = 0; i < num_configs; i++) {
rc = RRConvertCrtcConfig(client, screen, &screen_config,
@@ -1770,8 +1773,7 @@ ProcRRSetCrtcConfigs (ClientPtr client)
output_ids += x_configs[i].nOutput;
}
- if (num_configs &&
- !RRSetCrtcConfigs (screen, &screen_config, configs, num_configs))
+ if (!RRSetCrtcConfigs (screen, &screen_config, configs, num_configs))
{
rep.status = RRSetConfigFailed;
goto sendReply;