summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-23 11:16:48 -0800
committerKeith Packard <keithp@keithp.com>2011-02-23 11:16:48 -0800
commit00d0b235cfbfb162ddd58c088d2ed03e55a9c5cb (patch)
tree444602513521518f6bf79f6ff6e3e014a3f2dba1
parent93a73993708b1345c86ec3ec06b02ed236595673 (diff)
Revert "randr: handle RRSetCrtcConfigs request with zero configs"
-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;