diff options
author | Adam Jackson <ajax@redhat.com> | 2008-03-07 08:29:49 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-03-07 08:30:19 -0500 |
commit | 3fcb6445dc08f42488287162e3b7009d405e9c5b (patch) | |
tree | 00350d81ec5089439352995d4b59cc8c39de3b75 | |
parent | a8d760f567b19268329c4682495caa591f08a854 (diff) |
Fix segfault when a monitor exists but has no modes.
Thanks to Zhenyu Wang for finding this.
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 4d5d7b848..0bef5b42f 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1678,6 +1678,9 @@ nextAspectMode(DisplayModePtr start, float aspect) { DisplayModePtr m = start; + if (!m) + return NULL; + for (m = m->next; m; m = m->next) if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay)) return m; |