summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2021-12-05 21:59:12 +0100
committerPovilas Kanapickas <povilas@radix.lt>2021-12-06 23:27:35 +0200
commit75d70612888f18339703315549db781a22c0cb23 (patch)
tree98e99f5af6499a75c624092242813f980e308aa0 /hw
parented11c4d443ad2e82512df64358d38008e0ee7693 (diff)
Better fix for xf86CompatOut() when there are no privates
XF86_CRTC_CONFIG_PTR() will derefence privates[-1] in this case. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86Crtc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 7a562874c..e36adbe00 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -837,11 +837,11 @@ extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
static _X_INLINE xf86OutputPtr
xf86CompatOutput(ScrnInfoPtr pScrn)
{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcConfigPtr config;
if (xf86CrtcConfigPrivateIndex == -1)
return NULL;
-
+ config = XF86_CRTC_CONFIG_PTR(pScrn);
if (config->compat_output < 0)
return NULL;
return config->output[config->compat_output];