summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-12-17 16:09:35 +0200
committerKeith Packard <keithp@keithp.com>2010-12-20 00:46:32 -0800
commitd1107918d4626268803b54033a07405122278e7f (patch)
treec30b8759aa276ac3d370bb9fe054dca5a7fed3cd
parent4b88c7be8de4149fe3d166bf115775f9e81a1373 (diff)
randr: check for virtual size limits before set crtc
Return a error if the screen is configured to an invalid size. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--randr/rrscreen.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 292163f1d..0efc62e87 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -939,6 +939,18 @@ ProcRRSetScreenConfig (ClientPtr client)
width = mode->mode.height;
height = mode->mode.width;
}
+
+ if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
+ client->errorValue = width;
+ free(pData);
+ return BadValue;
+ }
+ if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) {
+ client->errorValue = height;
+ free(pData);
+ return BadValue;
+ }
+
if (width != pScreen->width || height != pScreen->height)
{
int c;