Fix segfault when a monitor exists but has no modes.

Thanks to Zhenyu Wang for finding this.
This commit is contained in:
Adam Jackson 2008-03-07 08:29:49 -05:00
parent a8d760f567
commit 3fcb6445dc

View File

@ -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;