summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2007-02-26 17:45:40 -0800
committerAaron Plattner <aplattner@nvidia.com>2007-02-28 12:35:50 -0800
commit8b245758845523d5f8f017bb9d0e9aa57b616c28 (patch)
treeb6d1aaf471d1724733c2be19c89c61830b06a39f /randr
parentd9bcb22d199e8444b9762a35754e04d327dd5915 (diff)
Return BadMatch if a client tries to clone non-cloneable outputs.
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index fdd1d429d..474c9465c 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -667,6 +667,27 @@ ProcRRSetCrtcConfig (ClientPtr client)
return BadMatch;
}
}
+ /* validate clones */
+ for (i = 0; i < numOutputs; i++)
+ {
+ for (j = 0; j < numOutputs; j++)
+ {
+ int k;
+ if (i == j)
+ continue;
+ for (k = 0; k < outputs[i]->numClones; k++)
+ {
+ if (outputs[i]->clones[k] == outputs[j])
+ break;
+ }
+ if (k == outputs[i]->numClones)
+ {
+ if (outputs)
+ xfree (outputs);
+ return BadMatch;
+ }
+ }
+ }
pScreen = crtc->pScreen;
pScrPriv = rrGetScrPriv(pScreen);