Skip to content

Commit

Permalink
randr: check for virtual size limits before set crtc
Browse files Browse the repository at this point in the history
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 d110791)
  • Loading branch information
tiagovignatti authored and nwnk committed Jan 6, 2011
1 parent a3c7b86 commit 08db658
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions randr/rrscreen.c
Expand Up @@ -915,6 +915,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;
Expand Down

0 comments on commit 08db658

Please sign in to comment.