diff options
author | Keith Packard <keithp@neko.keithp.com> | 2006-12-30 21:52:22 -0800 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-01-02 09:13:39 +1100 |
commit | e79602fca2f2cced66136729cdda4d356b0bdda0 (patch) | |
tree | ad7865509ec28b2a946372ca828e3c5df71d4e9c /randr/rrscreen.c | |
parent | dc5eb4523298f966bd5fd9ae6672160034b5e82c (diff) |
Use RRScreenSetSizeRange in 1.0 compat. Check RRGetInfo for error.
The RRScreenSizeSetRange function is used externally for 1.2 API drivers,
but can also be used in the 1.0 compatibility code. This also ensures that
the right changed bits are set so that clients are correctly notified when
the range changes.
RRGetInfo can return an error, use that to return BadAlloc to clients
instead of blindly going on with various requests.
(cherry picked from f05dd384d38c76dd9662933a03625dfef5b1c81f commit)
Diffstat (limited to 'randr/rrscreen.c')
-rw-r--r-- | randr/rrscreen.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 6f7afaf7a..7947f80eb 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -234,7 +234,8 @@ ProcRRGetScreenSizeRange (ClientPtr client) if (pScrPriv) { - RRGetInfo (pScreen); + if (!RRGetInfo (pScreen)) + return BadAlloc; rep.minWidth = pScrPriv->minWidth; rep.minHeight = pScrPriv->minHeight; rep.maxWidth = pScrPriv->maxWidth; @@ -349,7 +350,8 @@ ProcRRGetScreenResources (ClientPtr client) rep.pad = 0; if (pScrPriv) - RRGetInfo (pScreen); + if (!RRGetInfo (pScreen)) + return BadAlloc; if (!pScrPriv) { @@ -591,7 +593,8 @@ ProcRRGetScreenInfo (ClientPtr client) rep.pad = 0; if (pScrPriv) - RRGetInfo (pScreen); + if (!RRGetInfo (pScreen)) + return BadAlloc; output = RRFirstOutput (pScreen); |