diff options
author | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-10-08 13:33:55 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-10-08 13:33:55 +0800 |
commit | 56c615368c5a8e7acb0398434c2c68578626aa38 (patch) | |
tree | 6e0dfbe1ada24042f0bb397fc7d61f96c26bd38f | |
parent | 278c11f01fbc6d6bd91c5a7127928c9ef5d29fca (diff) |
Check nextEnabledOutput()'s return in bestModeForAspect()
In case no enabled outputs, we will reference wrong index of
output array.
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index ed2ae7a42..df47598aa 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1912,7 +1912,8 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) int o = -1, p; DisplayModePtr mode = NULL, test = NULL, match = NULL; - nextEnabledOutput(config, enabled, &o); + if (!nextEnabledOutput(config, enabled, &o)) + return NULL; while ((mode = nextAspectMode(config->output[o], mode, aspect))) { test = mode; for (p = o; nextEnabledOutput(config, enabled, &p); ) { |