Commit da678db0 authored by Tiago Vignatti's avatar Tiago Vignatti Committed by Ulrich Sibiller

Backport: randr: check for virtual size limits before set crtc

Return a error if the screen is configured to an invalid size. Signed-off-by: 's avatarTiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com> Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org> Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
parent 2aeb7671
......@@ -938,6 +938,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment