Return a error if the screen is configured to an invalid size.

Signed-off-by: Tiago Vignatti <[email protected]>
---
 randr/rrscreen.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 292163f..0efc62e 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;
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to