summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-12-05 23:35:28 -0800
committerKeith Packard <keithp@keithp.com>2010-12-06 20:09:11 -0800
commit0d01b66df9081ef48843b3bad81c56bb2cd1ae69 (patch)
tree2667da9631baf999855af77619613a6ca785841f
parentb0f4bd61f0caf80f3be9a176f1f7a707bc6628d8 (diff)
randr: handle RRSetCrtcConfigs request with zero configs
Need to actually return a reply in this case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--randr/rrcrtc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 0fc818887..5fe6900b1 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1750,9 +1750,6 @@ 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);
/*
@@ -1760,7 +1757,7 @@ ProcRRSetCrtcConfigs (ClientPtr client)
* server crtc configurations
*/
configs = calloc(num_configs, sizeof (RRCrtcConfigRec));
- if (!configs)
+ if (num_configs > 0 && configs == NULL)
return BadAlloc;
for (i = 0; i < num_configs; i++) {
rc = RRConvertCrtcConfig(client, screen, &screen_config,
@@ -1773,7 +1770,8 @@ ProcRRSetCrtcConfigs (ClientPtr client)
output_ids += x_configs[i].nOutput;
}
- if (!RRSetCrtcConfigs (screen, &screen_config, configs, num_configs))
+ if (num_configs &&
+ !RRSetCrtcConfigs (screen, &screen_config, configs, num_configs))
{
rep.status = RRSetConfigFailed;
goto sendReply;