diff options
author | Jason Gerecke <killertofu@gmail.com> | 2015-04-30 18:06:14 -0700 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-05-07 14:01:57 -0400 |
commit | 28159eff6badf6181b255f26d1f444abe81c05b7 (patch) | |
tree | 59ff6dd496aacd6e0ed905b1850fb3b07eb4fced | |
parent | cad831f39861435cb94f4c90a73f7f0b62d1a4a1 (diff) |
xfree86: Return NULL from xf86CompatOutput if no compat_output is defined
If no compat_output is defined, we inadvertently (attempt to) return
whatever data is at index -1. Instead, return NULL since that's what
callers are expecting.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 3c5bbcfd5..8b0160845 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -745,6 +745,8 @@ xf86CompatOutput(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + if (config->compat_output < 0) + return NULL; return config->output[config->compat_output]; } |