summaryrefslogtreecommitdiff
path: root/hw/xfree86/modes
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-06-05 11:57:39 +1000
committerDave Airlie <airlied@redhat.com>2009-06-05 12:04:03 +1000
commitb6c16fc7dad5a4ffcaaab647c0e3fabed372efd5 (patch)
treefc79eff24c1aa76d39aba41ff60e63a9f75373f9 /hw/xfree86/modes
parentda682abc78c9a5b2fde09679061fe08a3a1c665b (diff)
crtc/gamma: check xf86_config is valid before using it.
If you have multiple cards, some that support randr 1.2 and some that don't you can get a null dereference in here. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'hw/xfree86/modes')
-rw-r--r--hw/xfree86/modes/xf86Crtc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 0ab2f3df9..b40e09605 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3140,6 +3140,9 @@ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc;
+ /* for multiple drivers loaded we need this */
+ if (!xf86_config)
+ return FALSE;
if (xf86_config->num_crtc == 0)
return FALSE;
crtc = xf86_config->crtc[0];