summaryrefslogtreecommitdiff
path: root/hw/xfree86/modes/xf86Crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/modes/xf86Crtc.c')
-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 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;