From 00d0b235cfbfb162ddd58c088d2ed03e55a9c5cb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 23 Feb 2011 11:16:48 -0800 Subject: Revert "randr: handle RRSetCrtcConfigs request with zero configs" This reverts commit 0d01b66df9081ef48843b3bad81c56bb2cd1ae69. --- randr/rrcrtc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'randr') 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; -- cgit v1.2.3