aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rroutput.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/rroutput.c')
-rw-r--r--xorg-server/randr/rroutput.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c
index 0890c55b5..fbd0e32b3 100644
--- a/xorg-server/randr/rroutput.c
+++ b/xorg-server/randr/rroutput.c
@@ -528,13 +528,13 @@ ProcRRSetOutputPrimary(ClientPtr client)
RROutputPtr output = NULL;
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
- int rc;
+ int ret;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
+ ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (ret != Success)
+ return ret;
if (stuff->output) {
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
@@ -546,7 +546,8 @@ ProcRRSetOutputPrimary(ClientPtr client)
}
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
- RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
+ if (pScrPriv)
+ RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
return Success;
}