summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-29 14:41:39 +0100
committerDave Airlie <airlied@redhat.com>2012-07-07 10:37:11 +0100
commitc5cc2a8243c5e6bf454af989b7512ec7e20fc3f2 (patch)
treecc714b43b7dd86e6a40840dbbf2e3c4872d7afc9 /randr
parent26d848cb916c8a85f2c69d2aeb004665ba07bf00 (diff)
randr: check the screen size bounds against the master
The master contains the complete screen size bounds, so check the width/height against it. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e5fe059f8..949ae6028 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1125,6 +1125,16 @@ ProcRRSetCrtcConfig(ClientPtr client)
int source_height;
PictTransform transform;
struct pixman_f_transform f_transform, f_inverse;
+ int width, height;
+
+ if (pScreen->isGPU) {
+ width = pScreen->current_master->width;
+ height = pScreen->current_master->height;
+ }
+ else {
+ width = pScreen->width;
+ height = pScreen->height;
+ }
RRTransformCompute(stuff->x, stuff->y,
mode->mode.width, mode->mode.height,
@@ -1134,13 +1144,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
RRModeGetScanoutSize(mode, &transform, &source_width,
&source_height);
- if (stuff->x + source_width > pScreen->width) {
+ if (stuff->x + source_width > width) {
client->errorValue = stuff->x;
free(outputs);
return BadValue;
}
- if (stuff->y + source_height > pScreen->height) {
+ if (stuff->y + source_height > height) {
client->errorValue = stuff->y;
free(outputs);
return BadValue;