diff options
author | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-12-17 16:09:35 +0200 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-01-11 11:15:26 -0800 |
commit | 588d3f259a7243c44fe89d31e41605a2b5acbf41 (patch) | |
tree | a693fa2530d4c363c2f5aec33bddd3d22a467b84 | |
parent | 205efedddc3e966633d63d2d7907148a34bc67f6 (diff) | |
download | xserver-588d3f259a7243c44fe89d31e41605a2b5acbf41.tar.gz |
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>
(cherry picked from commit d1107918d4626268803b54033a07405122278e7f)
-rw-r--r-- | randr/rrscreen.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 630ff5742..0fee1f57c 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -921,6 +921,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; |