summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2007-02-26 17:45:40 -0800
committerKeith Packard <keithp@guitar.keithp.com>2007-03-03 22:21:32 -0800
commit0104f5737bf16ad9cdf0cd3a0e20328c5364e8c7 (patch)
treea1939122310f17e1ab431e455612a0cc56d0ab8a
parentaeabf2a1f873f884b8a8c33b1517c3f3cab4c7f5 (diff)
Return BadMatch if a client tries to clone non-cloneable outputs.
(cherry picked from commit 8b245758845523d5f8f017bb9d0e9aa57b616c28)
-rw-r--r--randr/rrcrtc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index a90b07289..3cdf12c9f 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -670,6 +670,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);