summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <ricardo.salveti@linaro.org>2012-06-21 00:55:53 -0300
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-01 17:30:15 -0700
commitba0fe0092c25556e682d7b51fa94cafb75c00f3e (patch)
tree37a3af3ca37dd859185df34e09b609b34be32658
parentb348cfd4b85e10e1ff36344473758325201c3816 (diff)
randr: first check pScrPriv before using the pointer at RRFirstOutput
Fix a seg fault in case pScrPriv is NULL at ProcRRGetScreenInfo, which later calls RRFirstOutput. Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 32603f57ca03b6390b109960f8bb5ea53ac95ecb)
-rw-r--r--randr/randr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/randr/randr.c b/randr/randr.c
index 5c1f70cb3..dbd381054 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen)
RROutputPtr output;
int i, j;
+ if (!pScrPriv)
+ return NULL;
+
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
return pScrPriv->primaryOutput;